/* ============================================================
   layout.css – App Shell, SPA Container, Responsive Grid
   ============================================================ */

/* ── App Shell ── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--color-bg);
}

/* ── Screen Container ── */
.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.screen.active {
  display: flex;
}

/* ── Top Header Bar ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 var(--space-md);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  z-index: 10;
}

.app-header__left,
.app-header__right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.app-header__title {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-medium);
  flex: 1;
  text-align: center;
}

/* ── Icon Button ── */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.icon-btn:hover, .icon-btn:active {
  color: var(--color-text);
  background: var(--color-surface);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ── Content Area ── */
.screen-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

/* ── Setup Screen Layout ── */
.setup-screen {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* ── Game Screen Layout (Mobile Portrait) ── */
.game-screen {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.game-screen__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 var(--space-md);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.game-screen__header-info {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-align: center;
  flex: 1;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.02em;
}

.game-screen__scoreboard {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.game-screen__keyboard {
  flex-shrink: 0;
  background: var(--color-keyboard-bg);
}


/* ── Players Screen ── */
.players-screen {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* ── History Screen ── */
.history-screen {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* ── Fullscreen ── */
:fullscreen .game-screen {
  height: 100vh;
}

:-webkit-full-screen .game-screen {
  height: 100vh;
}

/* ── Modal Overlay ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--space-md);
}

.modal {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-overlay);
}

.modal__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-md);
  text-align: center;
}
