@font-face {
  font-family: 'ThreeKingdoms3Font';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_eight@1.0/Sam3KRFont.woff') format('woff');
  font-weight: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --terminal-fallback-font: 'ThreeKingdoms3Font', 'Noto Sans Mono CJK KR', 'Noto Sans KR', 'IBM Plex Mono', 'Courier New', monospace;
  --terminal-title-font: var(--terminal-fallback-font);
  font-family: var(--terminal-fallback-font);
  --accent-blue: #2d57a1;
  --accent-blue-bright: #5f88d6;
  --accent-blue-deep: #16263f;
  --ink-white: #f2f5fb;
  --ink-gray: #c1c8d8;
  --panel-gray: #9da9bf;
  --panel-dark: #222b39;
  --terminal-bg: #020409;
  --surface-0: #111827;
  --surface-1: #2b3549;
  --border-dark: #0b0f18;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #060a12;
  color: var(--ink-white);
  height: 100dvh;
  overflow: hidden;
  text-shadow: none;
}

.app {
  height: 100dvh;
  position: relative;
  isolation: isolate;
}

.join-screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.join-card {
  width: min(460px, 100%);
  border: 2px solid var(--border-dark);
  border-radius: 0;
  background: linear-gradient(180deg, #3c4963 0%, #242d3c 100%);
  padding: 28px 26px;
  box-shadow: 6px 6px 0 #0a0f18, inset 1px 1px 0 rgba(255, 255, 255, 0.25);
}

.eyebrow {
  margin: 0;
  color: #d8e4ff;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.title {
  margin: 8px 0 0;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.subtitle {
  margin: 12px 0 22px;
  color: var(--ink-gray);
  line-height: 1.5;
}

.join-button,
.action-button {
  border: 2px solid #0f1520;
  color: var(--ink-white);
  background: linear-gradient(180deg, #7486a6 0%, #3b4a63 100%);
  border-radius: 0;
  cursor: pointer;
  font-family: var(--terminal-fallback-font);
}

.join-button {
  min-width: 190px;
  min-height: 58px;
  font-size: 1rem;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #7288ad 0%, #455673 100%);
  border-color: #151b27;
  box-shadow: 3px 3px 0 #0a0f18, inset 1px 1px 0 rgba(255, 255, 255, 0.2);
}

.terminal-screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.terminal-card {
  width: min(980px, 94vw);
  height: min(72dvh, 640px);
  border: 2px solid #080c14;
  border-radius: 0;
  background: var(--surface-0);
  padding: 0;
  box-shadow: 8px 8px 0 #060b14;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 2px solid #0e1522;
  background: var(--surface-1);
  position: relative;
}

.terminal-title {
  margin: 0;
  font-family: var(--terminal-title-font);
  font-size: 0.82rem;
  color: var(--ink-white);
  letter-spacing: 0.08em;
  text-transform: none;
  text-align: center;
}

.terminal-actions {
  display: flex;
  gap: 8px;
}

.terminal-shell {
  flex: 1;
  border-top: 2px solid #0e1522;
  border-radius: 0;
  padding: 14px;
  background: var(--terminal-bg);
  overflow: hidden;
  min-height: 0;
  box-shadow: inset 0 0 0 2px rgba(71, 95, 137, 0.7);
}

.terminal-shell .xterm {
  font-family: var(--terminal-fallback-font);
  color: var(--ink-white);
  letter-spacing: 0.02em;
}

.terminal-shell .xterm-viewport {
  scrollbar-color: var(--accent-blue-bright) #040813;
}

.terminal-shell .xterm-screen canvas {
  filter: none;
}

.action-button {
  min-width: 96px;
  min-height: 44px;
  letter-spacing: 0.04em;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  box-shadow: 2px 2px 0 #0a0f18, inset 1px 1px 0 rgba(255, 255, 255, 0.16);
}

.join-button:hover,
.action-button:hover {
  transform: translateY(-1px);
  border-color: #d7e4ff;
  box-shadow: 3px 3px 0 #0a0f18, inset 1px 1px 0 rgba(255, 255, 255, 0.22);
}

.join-button:focus-visible,
.action-button:focus-visible {
  outline: 2px solid #d7e4ff;
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .terminal-screen {
    padding: 14px;
  }

  .terminal-card {
    width: 100%;
    height: min(78dvh, 680px);
  }

  .terminal-shell {
    padding: 10px;
  }
}
