:root {
  --bg: #f5efe2;
  --bg-strong: #fffaf0;
  --ink: #11212d;
  --muted: #4f6470;
  --line: rgba(17, 33, 45, 0.12);
  --primary: #eb5e28;
  --primary-dark: #b94318;
  --secondary: #0f8b8d;
  --accent: #ffbf69;
  --card: rgba(255, 250, 240, 0.9);
  --shadow: 0 24px 70px rgba(17, 33, 45, 0.12);
  --radius: 26px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 191, 105, 0.42), transparent 25%),
    radial-gradient(circle at top right, rgba(15, 139, 141, 0.24), transparent 20%),
    linear-gradient(180deg, #f9f4ea 0%, #f4ecdc 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 18rem;
  height: 18rem;
  border-radius: 40px;
  opacity: 0.22;
  z-index: 0;
  transform: rotate(12deg);
  pointer-events: none;
}

body::before {
  right: -4rem;
  bottom: 8rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

body::after {
  left: -6rem;
  top: 10rem;
  background: linear-gradient(135deg, var(--secondary), #66c7c8);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 4rem;
}

.site-header,
.hero,
.game-card,
.plan-card,
.auth-card,
.dashboard-card,
.info-panel,
.widget-shell,
.history-panel,
.form-card,
.admin-item,
.switch-row {
  backdrop-filter: blur(14px);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.game-card,
.plan-card,
.auth-card,
.dashboard-card,
.info-panel,
.widget-shell,
.history-panel,
.form-card,
.admin-item,
.switch-row {
  position: relative;
  overflow: hidden;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-radius: calc(var(--radius) - 8px);
  margin-top: 0.4rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
  text-decoration: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.helper-text,
.hero-text,
.game-card p,
.plan-card p,
.payment-form p,
.widget-shell p,
.history-list p {
  color: var(--muted);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-weight: 700;
  font-size: 1.25rem;
}

.site-nav {
  display: flex;
  gap: 1rem;
}

.site-nav a {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

main {
  display: grid;
  gap: 1.6rem;
  margin-top: 1.6rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 1.4rem;
  border-radius: var(--radius);
  padding: 2rem;
}

.eyebrow {
  margin: 0 0 0.7rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  color: var(--secondary);
}

.hero h1,
.section-heading h2 {
  margin: 0;
  line-height: 1.05;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  max-width: 12ch;
}

.hero-text {
  max-width: 46rem;
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-panel {
  display: grid;
  gap: 0.9rem;
}

.hero-stat {
  padding: 1.1rem 1.2rem;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.88), rgba(255, 191, 105, 0.16));
  border: 1px solid var(--line);
}

.hero-stat span,
.plan-card strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
}

.hero-stat small {
  color: var(--muted);
}

.hero-actions,
.button-row,
.history-panel__head,
.dashboard-header,
.auth-switch {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

section {
  display: grid;
  gap: 1rem;
}

.section-heading {
  max-width: 46rem;
}

.section-heading--compact {
  max-width: none;
}

.section-heading h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.game-grid,
.plan-grid,
.dashboard-grid {
  display: grid;
  gap: 1rem;
}

.game-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-grid--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.game-card,
.plan-card,
.auth-card,
.dashboard-card {
  border-radius: var(--radius);
  padding: 1.4rem;
}

.game-card__head,
.payment-form__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.game-card__head span,
.plan-card span,
.history-item__status {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.text-input {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(17, 33, 45, 0.18);
  background: rgba(255, 255, 255, 0.88);
  font: inherit;
  color: inherit;
}

.text-input:focus {
  outline: 2px solid rgba(15, 139, 141, 0.24);
  border-color: var(--secondary);
}

.text-input:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

button {
  font: inherit;
  cursor: pointer;
}

.primary-button,
.secondary-button,
.ghost-button,
.auth-tab,
.tic-board button,
.memory-card {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.primary-button,
.secondary-button,
.ghost-button,
.auth-tab {
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  border: 1px solid transparent;
}

.primary-button {
  background: linear-gradient(135deg, var(--primary), #ff7f50);
  color: white;
  box-shadow: 0 16px 30px rgba(235, 94, 40, 0.26);
}

.secondary-button {
  background: linear-gradient(135deg, var(--secondary), #2fb4b6);
  color: white;
  box-shadow: 0 16px 30px rgba(15, 139, 141, 0.24);
}

.ghost-button,
.auth-tab {
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  border-color: var(--line);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.auth-tab:hover,
.tic-board button:hover,
.memory-card:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-tab.active {
  background: var(--ink);
  color: white;
}

.game-feedback,
.helper-text {
  margin: 0;
  font-size: 0.95rem;
}

.tic-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.tic-board button {
  aspect-ratio: 1;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.memory-card {
  aspect-ratio: 1;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(15, 139, 141, 0.14), rgba(255, 191, 105, 0.4));
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  color: transparent;
}

.memory-card.is-revealed,
.memory-card.is-matched {
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
}

.memory-card.is-matched {
  border-color: rgba(15, 139, 141, 0.34);
}

.plan-card {
  display: grid;
  gap: 0.6rem;
  border: 1px solid var(--line);
}

.plan-card--featured {
  background: linear-gradient(160deg, rgba(255, 191, 105, 0.18), rgba(255, 250, 240, 0.92));
  transform: translateY(-0.4rem);
}

.plan-card--selectable {
  align-content: start;
  min-height: 100%;
}

.plan-card--selected {
  border-color: rgba(15, 139, 141, 0.52);
  box-shadow: 0 18px 40px rgba(15, 139, 141, 0.18);
}

.cabinet-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 1rem;
}

.auth-card,
.dashboard-card {
  min-height: 100%;
}

.auth-card::after,
.dashboard-card::after,
.info-panel::after,
.widget-shell::after,
.history-panel::after,
.form-card::after {
  content: "";
  position: absolute;
  right: -2.2rem;
  bottom: -2.2rem;
  width: 8rem;
  height: 8rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 191, 105, 0.28), transparent 68%);
  pointer-events: none;
}

.auth-form,
.payment-form {
  display: grid;
  gap: 0.9rem;
}

.auth-form label,
.payment-form label {
  display: grid;
  gap: 0.4rem;
  font-weight: 500;
}

.dashboard-card {
  display: grid;
  gap: 1rem;
}

.cabinet-arcade {
  display: grid;
  gap: 1rem;
}

.arcade-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 1rem;
  align-items: start;
}

.arcade-game {
  gap: 1rem;
}

.arcade-inline-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.hero-stat--compact {
  padding: 0.9rem 1rem;
}

.hero-stat--compact span {
  font-size: 1.2rem;
}

.memory-board--cabinet .memory-card {
  min-height: 5.25rem;
  font-size: 1.1rem;
}

.info-panel,
.widget-shell,
.history-panel {
  border-radius: 22px;
  padding: 1rem 1.1rem;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.88), rgba(255, 191, 105, 0.12));
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.info-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.widget-shell__head,
.form-card__head {
  display: grid;
  gap: 0.35rem;
}

.widget-shell__head h4,
.form-card__head h4,
.info-panel h4,
.history-panel h4 {
  margin: 0;
}

#payment-widget {
  min-height: 260px;
}

.history-list {
  display: grid;
  gap: 0.8rem;
}

.history-item {
  display: grid;
  gap: 0.35rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(15, 139, 141, 0.08));
  border: 1px solid var(--line);
}

.history-item__top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.history-item__meta {
  color: var(--muted);
  font-size: 0.94rem;
}

.status-success {
  color: #0e7c4f;
}

.status-pending {
  color: #8a5c00;
}

.status-canceled {
  color: #ae2d2d;
}

.admin-panel {
  display: grid;
  gap: 1rem;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.form-card {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(255, 191, 105, 0.14));
}

.admin-list {
  display: grid;
  gap: 0.8rem;
}

.admin-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(15, 139, 141, 0.12));
}

.admin-item label {
  display: grid;
  gap: 0.4rem;
  min-width: 9rem;
}

.switch-row {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(235, 94, 40, 0.08));
}

.switch-row input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--secondary);
}

.info-badge,
code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(235, 94, 40, 0.18);
  background: linear-gradient(135deg, rgba(255, 191, 105, 0.28), rgba(235, 94, 40, 0.1));
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

code {
  border-radius: 14px;
  color: var(--ink);
  letter-spacing: normal;
  text-transform: none;
  overflow-wrap: anywhere;
}

.plan-card--selectable,
.info-panel,
.widget-shell,
.history-panel,
.form-card,
.admin-item,
.switch-row {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.plan-card--selectable:hover,
.info-panel:hover,
.widget-shell:hover,
.history-panel:hover,
.form-card:hover,
.admin-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 44px rgba(17, 33, 45, 0.16);
}

.hidden {
  display: none !important;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
}

.reveal.is-visible {
  animation: reveal-in 620ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes reveal-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero,
  .cabinet-layout,
  .arcade-layout,
  .game-grid,
  .plan-grid,
  .plan-grid--compact,
  .dashboard-grid,
  .payment-grid,
  .mini-stats,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .site-header {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav {
    justify-content: space-between;
  }

  .plan-card--featured {
    transform: none;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 1rem, 100%);
  }

  .site-header,
  .hero,
  .game-card,
  .plan-card,
  .auth-card,
  .dashboard-card {
    padding: 1rem;
  }

  .hero h1 {
    max-width: none;
  }

  .site-nav {
    gap: 0.7rem;
    flex-wrap: wrap;
  }

  .admin-item,
  .history-item__top,
  .payment-form__head {
    flex-direction: column;
  }

  .arcade-inline-stats {
    grid-template-columns: 1fr;
  }
}
