/* shared/core.css — base styling for terminal, globe, game, matrix, contact.
   Both directions import this; their direction-specific CSS overrides as needed. */

/* ============================================================
   ASCII GLOBE
   ============================================================ */
.ag-wrap{
  display: flex;
  gap: 24px;
  align-items: stretch;
  width: 100%;
  height: 100%;
  background: #04110a;
  padding: 16px;
  box-sizing: border-box;
  text-shadow: 0 0 6px currentColor, 0 0 14px currentColor;
}
.ag-frame{
  font: 13px/1.0 "VT323", "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.5px;
  margin: 0;
  white-space: pre;
  color: inherit;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ag-hud{
  width: 260px;
  font: 13px/1.4 "IBM Plex Mono", ui-monospace, monospace;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.ag-hud-row{
  display: flex;
  gap: 10px;
  text-shadow: 0 0 4px currentColor;
}
.ag-hud-key{ opacity: 0.6; min-width: 30px; }
.ag-hud-val{ font-weight: 600; }
.ag-hud-divider{ margin-top: 12px; opacity: 0.6; }
.ag-hud-event{ font-size: 12px; line-height: 1.4; }
.ag-dim{ opacity: 0.5; }

/* ============================================================
   TERMINAL
   ============================================================ */
.tm-shell{
  --tm-accent: #34ff66;
  position: relative;
  background: #04110a;
  color: var(--tm-accent);
  font-family: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(52,255,102,0.25), 0 20px 60px rgba(0,0,0,0.6);
  text-shadow: 0 0 6px currentColor;
}
.tm-titlebar{
  background: linear-gradient(180deg, rgba(52,255,102,0.18), rgba(52,255,102,0.06));
  border-bottom: 1px solid rgba(52,255,102,0.4);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  flex-shrink: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tm-titlebar-dot{ width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 4px currentColor; }
.tm-tb-r{ background: #ff5252; color: #ff5252; }
.tm-tb-y{ background: #ffd152; color: #ffd152; }
.tm-tb-g{ background: #34ff66; color: #34ff66; }
.tm-titlebar-title{ margin-left: 8px; font-weight: 500; opacity: 0.9; }
.tm-titlebar-spec{ margin-left: auto; opacity: 0.5; font-size: 10px; }
.tm-scroll{
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 18px 60px;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(52,255,102,0.3) transparent;
}
.tm-scroll::-webkit-scrollbar{ width: 8px; }
.tm-scroll::-webkit-scrollbar-thumb{ background: rgba(52,255,102,0.3); }
.tm-line{ white-space: pre-wrap; word-break: break-word; }
.tm-line.tx-dim{ opacity: 0.55; }
.tm-line.tx-bright{ color: #c9ffd5; }
.tm-line.tx-err{ color: #ff5e6c; text-shadow: 0 0 6px rgba(255,94,108,0.5); }
.tm-line.tx-accent{ color: var(--tm-accent); opacity: 0.85; }
.tm-line.tx-prompt{ color: #c9ffd5; }
.tm-line.tx-link{ color: #79f2c0; }
.tm-prompt-line{ position: relative; display: flex; flex-wrap: wrap; }
.tm-prompt-glyph{ color: #c9ffd5; }
.tm-input-wrap{ position: relative; flex: 1; display: inline-flex; align-items: baseline; }
.tm-input-text{ color: var(--tm-accent); }
.tm-cursor{
  display: inline-block;
  width: 0.6em;
  margin-left: 2px;
  color: var(--tm-accent);
  animation: tm-blink 1s steps(2, end) infinite;
}
@keyframes tm-blink{ 50%{ opacity: 0; } }
.tm-input-hidden{
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  opacity: 0;
  border: 0;
  outline: 0;
  font: inherit;
  color: transparent;
  background: transparent;
  caret-color: transparent;
}

/* CRT scanline overlay (apply to a container with .crt) */
.crt{
  position: relative;
}
.crt::before, .crt::after{
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  mix-blend-mode: overlay;
}
.crt::before{
  background-image: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.18) 0px,
    rgba(0,0,0,0.18) 1px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0) 3px
  );
}
.crt::after{
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 50%, rgba(0,0,0,0.55) 100%);
  mix-blend-mode: multiply;
}

/* ============================================================
   MATRIX RAIN
   ============================================================ */
.mx-overlay{
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #000;
  cursor: pointer;
  overflow: hidden;
}
.mx-canvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.mx-banner{
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: #c9ffd5;
  text-shadow: 0 0 16px #34ff66, 0 0 4px #34ff66;
  pointer-events: none;
}
.mx-banner-line{ font-size: 22px; letter-spacing: 0.4em; }
.mx-dim{ opacity: 0.6; font-size: 12px; letter-spacing: 0.2em; margin-top: 14px; }

/* ============================================================
   HACK WARS GAME
   ============================================================ */
.gw-root{
  --gw-accent: #34ff66;
  --gw-bg: #04110a;
  --gw-panel: rgba(255,255,255,0.02);
  --gw-border: rgba(52,255,102,0.25);
  background: var(--gw-bg);
  color: var(--gw-accent);
  font-family: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
  width: 100%;
  height: 100%;
  text-shadow: 0 0 6px currentColor;
}
.gw-frame{
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px;
  gap: 10px;
  box-sizing: border-box;
}
.gw-statusbar{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(52,255,102,0.06);
  border: 1px solid var(--gw-border);
  border-radius: 4px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.gw-logo{ font-weight: 700; font-size: 14px; color: #c9ffd5; }
.gw-logo-dot{ color: var(--gw-accent); }
.gw-status-pill{
  padding: 4px 8px;
  border: 1px solid var(--gw-border);
  border-radius: 3px;
  background: rgba(0,0,0,0.3);
}
.gw-status-pill b{ color: #c9ffd5; font-weight: 700; }
.gw-spacer{ flex: 1; }
.gw-btn{
  font: inherit; font-size: 11px;
  background: transparent;
  border: 1px solid var(--gw-border);
  color: var(--gw-accent);
  padding: 4px 10px;
  cursor: pointer;
  letter-spacing: 0.1em;
}
.gw-btn:hover{ background: rgba(52,255,102,0.1); }

.gw-main{
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 10px;
  min-height: 0;
}
.gw-map{
  position: relative;
  border: 1px solid var(--gw-border);
  background: rgba(0,0,0,0.4);
  border-radius: 4px;
  overflow: hidden;
  min-height: 0;
}
.gw-mapwrap{ width: 100%; height: 100%; padding: 12px; box-sizing: border-box; }
.gw-svg{ width: 100%; height: 100%; }

.gw-intro{
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 32px;
}
.gw-title{
  font-size: 56px; font-weight: 900; letter-spacing: 0.06em;
  margin: 0 0 10px; color: #c9ffd5;
}
.gw-title span{ color: var(--gw-accent); }
.gw-art{ color: var(--gw-accent); margin: 0 0 20px; font-size: 11px; line-height: 1.0; opacity: 0.7; }
.gw-lede{ max-width: 480px; line-height: 1.6; font-size: 13px; }
.gw-rules{ margin: 16px 0 22px; font-size: 12px; opacity: 0.75; line-height: 1.8; }
.gw-cta{
  font: inherit; font-size: 14px; font-weight: 700;
  background: var(--gw-accent);
  color: #04110a; text-shadow: none;
  border: 0; padding: 12px 28px;
  cursor: pointer;
  letter-spacing: 0.15em;
  box-shadow: 0 0 20px rgba(52,255,102,0.4);
}
.gw-cta:hover{ background: #c9ffd5; }

.gw-crack{
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, 90%);
  background: rgba(4,17,10,0.95);
  border: 1px solid var(--gw-accent);
  box-shadow: 0 0 40px rgba(52,255,102,0.4);
  padding: 18px 22px;
  border-radius: 4px;
}
.gw-crack-head{
  display: flex; justify-content: space-between;
  font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.gw-crack-target{ color: #c9ffd5; font-weight: 700; }
.gw-crack-time{ color: var(--gw-accent); }
.gw-crack-bar{
  height: 4px; background: rgba(52,255,102,0.15);
  margin-bottom: 18px;
  overflow: hidden;
}
.gw-crack-bar-fill{ height: 100%; background: var(--gw-accent); transition: width 80ms linear; }
.gw-crack-hash{
  font-size: 28px;
  letter-spacing: 0.2em;
  text-align: center;
  margin-bottom: 12px;
  font-weight: 700;
}
.gw-char{ color: rgba(255,255,255,0.2); transition: color 100ms; }
.gw-char.done{ color: var(--gw-accent); text-shadow: 0 0 12px var(--gw-accent); }
.gw-char.here{ color: #c9ffd5; animation: gw-pulse 0.6s ease-in-out infinite; }
@keyframes gw-pulse{ 50%{ opacity: 0.4; } }
.gw-crack-hint{ text-align: center; font-size: 11px; opacity: 0.6; letter-spacing: 0.1em; }

.gw-over{
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px;
  background: rgba(4,17,10,0.94);
}
.gw-over h2{ font-size: 32px; color: #c9ffd5; margin: 0 0 24px; letter-spacing: 0.1em; }

.gw-standings{
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 28px;
  min-width: 360px;
}
.gw-stand-row{
  display: grid; grid-template-columns: 40px 16px 1fr 80px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--gw-border);
}
.gw-stand-row.you{ background: rgba(52,255,102,0.1); }
.gw-rank{ font-weight: 700; color: #c9ffd5; }
.gw-stand-dot{ width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.gw-stand-name{ font-weight: 600; letter-spacing: 0.06em; }
.gw-stand-score{ text-align: right; color: #c9ffd5; }

.gw-side{
  display: flex; flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.gw-panel{
  border: 1px solid var(--gw-border);
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
  padding: 10px 12px;
  display: flex; flex-direction: column;
  min-height: 0;
}
.gw-feed-panel{ flex: 1; }
.gw-panel-head{
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  opacity: 0.65; margin-bottom: 10px;
}
.gw-rivals{ display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.gw-rival{
  display: grid;
  grid-template-columns: 12px 1fr 40px;
  grid-template-rows: auto 4px;
  gap: 4px 8px;
  align-items: center;
}
.gw-rival-dot{ grid-row: 1 / 2; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.gw-rival-name{ font-weight: 600; }
.gw-rival-score{ text-align: right; color: #c9ffd5; font-weight: 700; }
.gw-rival-bar{
  grid-column: 1 / -1;
  height: 3px;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
}
.gw-rival-bar > div{ height: 100%; transition: width 240ms; }
.gw-feed{
  flex: 1; min-height: 0;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.5;
  display: flex; flex-direction: column-reverse;
}
.gw-feed::-webkit-scrollbar{ width: 6px; }
.gw-feed::-webkit-scrollbar-thumb{ background: rgba(52,255,102,0.2); }
.gw-feed-empty{ opacity: 0.4; }
.gw-feed-row{ padding: 2px 0; opacity: 0.85; }
.gw-feed-row.fd-good{ color: var(--gw-accent); text-shadow: 0 0 8px var(--gw-accent); }
.gw-feed-row.fd-bad{  color: #ff5e6c; text-shadow: 0 0 6px rgba(255,94,108,0.6); }
.gw-feed-row.fd-info{ color: #c9ffd5; opacity: 0.7; }

/* ============================================================
   CONTACT FORM
   ============================================================ */
.cf-form{
  --cf-accent: #34ff66;
  display: flex; flex-direction: column;
  gap: 12px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: var(--cf-accent);
  text-shadow: 0 0 4px currentColor;
}
.cf-row{ display: flex; flex-direction: column; gap: 4px; }
.cf-label{ font-size: 10px; letter-spacing: 0.15em; opacity: 0.7; }
.cf-input{
  font: inherit; font-size: 13px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(52,255,102,0.35);
  color: #c9ffd5;
  padding: 8px 10px;
  outline: none;
  border-radius: 0;
}
.cf-input:focus{ border-color: var(--cf-accent); box-shadow: 0 0 0 1px var(--cf-accent), 0 0 14px rgba(52,255,102,0.3); }
.cf-textarea{ resize: vertical; font-family: inherit; min-height: 110px; }
.cf-actions{ display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cf-submit{
  font: inherit; font-size: 12px; font-weight: 700;
  background: var(--cf-accent);
  color: #04110a;
  border: 0;
  padding: 10px 18px;
  letter-spacing: 0.15em;
  cursor: pointer;
  text-shadow: none;
}
.cf-submit:hover{ background: #c9ffd5; }
.cf-submit:disabled{ opacity: 0.5; cursor: wait; }
.cf-msg{ font-size: 11px; letter-spacing: 0.05em; }
.cf-ok{ color: var(--cf-accent); }
.cf-err{ color: #ff5e6c; text-shadow: 0 0 6px rgba(255,94,108,0.5); }
.cf-fineprint{ font-size: 10px; opacity: 0.4; letter-spacing: 0.05em; }

/* ============================================================
   BBS DOORS — 1996-era ANSI bulletin board
   ============================================================ */
.bd-root{
  width: 100%; height: 100%;
  background: #000;
  font-family: "VT323", "IBM Plex Mono", ui-monospace, monospace;
  font-size: 16px;
  line-height: 1.0;
  color: #aaaaaa;
  overflow: auto;
  text-shadow: 0 0 6px currentColor;
}
.bd-screen{
  padding: 28px 36px;
  min-height: 100%;
  position: relative;
}
.bd-dial{
  font-size: 18px;
  line-height: 1.4;
  white-space: pre-wrap;
  margin: 0;
}
.bd-dial > div{ animation: bd-flicker 100ms; }
@keyframes bd-flicker{ from{ opacity: 0; } to{ opacity: 1; } }

/* menu splash */
.bd-menu{
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 280ms, transform 280ms;
}
.bd-menu.shown{ opacity: 1; transform: translateY(0); }
.bd-splash{
  font-size: 15px;
  line-height: 1.05;
  margin: 0 0 18px;
  white-space: pre;
  letter-spacing: 0;
}
.bd-splash > div{ white-space: pre; }
.bd-prompt-line{
  font-size: 16px;
  margin-bottom: 14px;
  letter-spacing: 0.04em;
}
.bd-blink{ animation: bd-blink 1.1s steps(2) infinite; color: #ffff55; }
@keyframes bd-blink{ 50%{ opacity: 0; } }
.bd-table-head, .bd-table-foot{
  color: #ff55ff;
  font-size: 15px;
  line-height: 1.05;
  margin: 0;
  white-space: pre;
}
.bd-list{
  display: flex;
  flex-direction: column;
  font-size: 16px;
}
.bd-row{
  display: grid;
  grid-template-columns: auto auto 250px 1fr auto;
  gap: 0;
  align-items: center;
  padding: 1px 0;
  cursor: pointer;
}
.bd-row.sel{ background: rgba(170,0,170,0.18); }
.bd-row-num{ padding: 0 8px; font-variant-numeric: tabular-nums; }
.bd-row-name{ padding: 0 8px; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-row-tag{ padding: 0 8px; font-size: 14px; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-row-bar{ font-size: 16px; }
.bd-cta{
  display: flex;
  gap: 22px;
  margin-top: 22px;
  font-size: 14px;
  letter-spacing: 0.05em;
  align-items: center;
}

/* game splash */
.bd-game{
  display: flex; flex-direction: column;
  min-height: 100%;
}
.bd-game-connecting{
  margin: 24px 0;
  font-size: 18px;
  line-height: 1.6;
  white-space: pre;
}
.bd-game-art{
  white-space: pre;
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.05;
}
.bd-game-meta{
  border: 1px solid #00aaaa;
  padding: 10px 14px;
  margin-bottom: 14px;
  color: #aaaaaa;
  font-size: 14px;
  line-height: 1.6;
}
.bd-game-row{ display: flex; gap: 10px; }
.bd-mk{ color: #00aaaa; letter-spacing: 0.08em; }
.bd-game-term{ flex: 1; min-height: 320px; margin-bottom: 14px; display: flex; }
.bd-iframe{
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 1px solid #555555;
  background: #000;
}
.bd-game-notice{
  flex: 1;
  margin: 0;
  padding: 18px;
  border: 1px solid #ffff55;
  color: #ffff55;
  background: rgba(255,255,85,0.04);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
}
.bd-game-actions{
  display: flex; gap: 10px;
}
.bd-btn{
  font: inherit;
  background: transparent;
  border: 1px solid #aaaaaa;
  color: #aaaaaa;
  padding: 6px 14px;
  font-size: 14px;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-shadow: inherit;
}
.bd-btn:hover{ background: #ff55ff; color: #000; border-color: #ff55ff; text-shadow: none; }
