* {
  box-sizing: border-box;
}

:root {
  --page: #15120f;
  --panel: #f3eee5;
  --panel-deep: #25211d;
  --ink: #211c18;
  --ink-light: #f7efe1;
  --muted: #746a5d;
  --line: #cdbb9d;
  --line-dark: #493f34;
  --teal: #2f7890;
  --teal-dark: #195668;
  --rose: #c84f6a;
  --brass: #b88a3a;
  --danger: #9b493c;
  --shadow: rgba(0, 0, 0, 0.24);
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: Verdana, Geneva, sans-serif;
  background:
    linear-gradient(180deg, rgba(21, 18, 15, 0.92), rgba(21, 18, 15, 0.78)),
    repeating-linear-gradient(90deg, #393029 0, #393029 1px, #302821 1px, #302821 10px);
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100dvh;
  margin: 0 auto;
  padding: 18px 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}

.topbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-light);
}

.brand {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
}

.session-badge {
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(205, 187, 157, 0.28);
  border-radius: 8px;
  color: #eadcc4;
  background: rgba(0, 0, 0, 0.2);
  font-size: 13px;
}

.start-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
  align-items: stretch;
}

.game-panel,
.auth-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 52px var(--shadow);
}

.game-panel {
  min-height: 620px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: center;
  background: var(--panel);
}

.preview-art {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  border: 1px solid rgba(73, 63, 52, 0.18);
  border-radius: 8px;
  background: #efe5d4;
}

.game-copy {
  display: grid;
  gap: 16px;
  align-content: center;
}

.eyebrow {
  margin: 0;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: 44px;
  line-height: 1.04;
}

.account-summary {
  margin: 0;
  max-width: 44rem;
  color: var(--muted);
  line-height: 1.5;
}

.start-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-action,
.secondary-action,
.tab-button {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}

.primary-action {
  color: #fff8ea;
  background: var(--teal-dark);
  border-color: #134756;
}

.primary-action:hover {
  background: var(--teal);
}

.primary-action.disabled,
.primary-action:disabled {
  opacity: 0.48;
  pointer-events: none;
}

.secondary-action {
  color: var(--ink-light);
  background: var(--panel-deep);
  border-color: var(--line-dark);
}

.full-width {
  width: 100%;
}

.api-status,
.auth-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-message.error {
  color: var(--danger);
}

.auth-message.success {
  color: var(--teal-dark);
}

.auth-panel {
  padding: 16px;
  align-self: center;
  background: #fffaf0;
}

.tab-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(73, 63, 52, 0.16);
  border-radius: 8px;
  background: #eee3d2;
}

.tab-button {
  color: var(--ink);
  background: transparent;
}

.tab-button.active {
  color: #fff8ea;
  background: var(--brass);
}

.auth-form {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid #b7a78d;
  border-radius: 8px;
  color: var(--ink);
  background: #fffdf8;
}

input:focus {
  outline: 2px solid rgba(47, 120, 144, 0.28);
  border-color: var(--teal);
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 20px, 680px);
  }

  .start-grid,
  .game-panel {
    grid-template-columns: 1fr;
  }

  .game-panel {
    min-height: 0;
  }

  .preview-art {
    max-height: 360px;
  }

  h1 {
    font-size: 34px;
  }
}

@media (max-width: 520px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-panel,
  .game-panel {
    padding: 12px;
  }

  h1 {
    font-size: 30px;
  }
}
