:root {
  --ink: #0b0b13;
  --night: #090a12;
  --paper: #f5f2ea;
  --white: #fff;
  --violet: #6657ff;
  --violet-dark: #2c207f;
  --pink: #ff4ea3;
  --orange: #ff7848;
  --lime: #ccff50;
  --mint: #58e4b4;
  --cyan: #57d6ff;
  --line-dark: rgba(255,255,255,.13);
  --line-light: rgba(11,11,19,.13);
  --shadow: 0 28px 80px rgba(5,5,15,.24);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(255,78,163,.18), transparent 23rem),
    radial-gradient(circle at 88% 22%, rgba(102,87,255,.24), transparent 28rem),
    var(--night);
  font-family: "Manrope", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { color: inherit; }
.app-header {
  width: min(1180px, calc(100% - 32px));
  min-height: 86px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #fff;
}
.app-brand img { display: block; width: 164px; }
.app-nav { display: flex; align-items: center; gap: 18px; color: rgba(255,255,255,.72); font-size: .9rem; font-weight: 700; }
.app-nav a:hover { color: #fff; }
.account-link { border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 10px 15px; }
.app-main { width: min(980px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 80px; }
.app-main.wide { width: min(1180px, calc(100% - 32px)); }
.eyebrow { margin: 0 0 13px; color: var(--violet); font-size: .73rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow.light { color: var(--lime); }
.app-title { margin: 0; font-family: "Syne", sans-serif; font-size: clamp(2.5rem, 7vw, 5.4rem); letter-spacing: -.06em; line-height: .95; }
.app-lede { max-width: 650px; margin: 18px 0 0; color: #68666d; font-size: 1.05rem; line-height: 1.7; }
.surface {
  overflow: hidden;
  border-radius: 34px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.activation-layout { display: grid; grid-template-columns: .88fr 1.12fr; min-height: 610px; }
.book-art {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(145deg, var(--violet-dark), var(--violet) 55%, #8c4fff);
  padding: 42px;
}
.book-art::before {
  content: "";
  position: absolute;
  width: 330px;
  height: 330px;
  right: -100px;
  bottom: -90px;
  border: 78px solid rgba(204,255,80,.9);
  border-radius: 50%;
}
.book-art::after {
  content: "✦";
  position: absolute;
  right: 47px;
  top: 44px;
  color: var(--lime);
  font-size: 3.2rem;
  transform: rotate(18deg);
}
.book-mark { display: inline-flex; padding: 9px 12px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.book-art h1 { position: relative; z-index: 1; margin: 90px 0 19px; font-family: "Syne", sans-serif; font-size: clamp(2.6rem, 5vw, 4.6rem); line-height: .94; letter-spacing: -.06em; }
.book-art p { position: relative; z-index: 1; max-width: 390px; color: rgba(255,255,255,.7); line-height: 1.65; }
.feature-chips { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.feature-chips span { padding: 9px 11px; border-radius: 999px; background: rgba(11,11,19,.2); font-size: .73rem; font-weight: 700; }
.activation-panel { padding: 48px; display: flex; flex-direction: column; justify-content: center; }
.activation-panel h2, .panel-card h2 { margin: 0 0 13px; font-family: "Syne", sans-serif; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.045em; }
.activation-panel > p, .panel-card > p { color: #6d6a71; line-height: 1.65; }
.access-pill { display: flex; justify-content: space-between; gap: 20px; margin: 25px 0; padding: 16px 18px; border-radius: 15px; background: #e9e5d8; }
.access-pill span { color: #706d73; }
.access-pill strong { color: var(--violet-dark); }
.app-button {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 800;
  transition: transform .2s ease, opacity .2s ease;
}
.app-button:hover:not(:disabled) { transform: translateY(-2px); }
.app-button:disabled { cursor: wait; opacity: .6; }
.app-button.primary { background: var(--violet); color: #fff; box-shadow: 0 12px 30px rgba(102,87,255,.25); }
.app-button.dark { background: var(--ink); color: #fff; }
.app-button.light { border: 1px solid var(--line-light); background: #fff; }
.app-button.lime { background: var(--lime); color: var(--ink); }
.app-button.wide { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin: 22px 0; border-radius: 999px; background: #e9e5d8; }
.auth-tab { min-height: 43px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; font-weight: 800; }
.auth-tab.active { background: #fff; box-shadow: 0 3px 12px rgba(0,0,0,.09); }
.auth-form { display: grid; gap: 14px; }
.auth-form label, .field { display: grid; gap: 7px; color: #555259; font-size: .78rem; font-weight: 800; }
.auth-form input, .field input, .field select {
  width: 100%; min-height: 50px; border: 1px solid rgba(11,11,19,.15); border-radius: 13px;
  background: #fff; padding: 0 15px; outline: none;
}
.auth-form input:focus, .field input:focus, .field select:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(102,87,255,.1); }
.form-error, .status-error { margin: 0; padding: 12px 14px; border-radius: 12px; color: #851c42; background: #ffe3ee; line-height: 1.45; }
.status-success { padding: 13px 15px; border-radius: 13px; background: #e6ffd1; color: #274b0b; }
.loading-card, .message-card, .panel-card { border-radius: 28px; background: var(--paper); padding: 38px; box-shadow: var(--shadow); }
.loading-card { text-align: center; color: #68666d; }
.spinner { width: 34px; height: 34px; margin: 0 auto 18px; border: 3px solid #ddd7c9; border-top-color: var(--violet); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.library-heading { margin-bottom: 34px; color: #fff; }
.library-heading .app-lede { color: rgba(255,255,255,.58); }
.library-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.book-card { position: relative; overflow: hidden; border-radius: 28px; background: var(--paper); box-shadow: var(--shadow); }
.book-card-top { min-height: 180px; padding: 28px; color: #fff; background: linear-gradient(135deg, var(--violet-dark), var(--violet)); }
.book-card-top::after { content: "✦"; position: absolute; right: 25px; top: 19px; color: var(--lime); font-size: 2.4rem; }
.book-card-top h2 { max-width: 360px; margin: 50px 0 0; font-family: "Syne", sans-serif; font-size: 2rem; line-height: 1; letter-spacing: -.045em; }
.book-card-body { padding: 25px 28px 28px; }
.status-line { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.status-badge { padding: 7px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.status-badge.active { color: #244b08; background: #dcffc0; }
.status-badge.expired { color: #7b2440; background: #ffe1eb; }
.expiry-date { margin: 18px 0 5px; font-weight: 800; }
.remaining { margin: 0 0 22px; color: #747178; font-size: .87rem; }
.empty-state { grid-column: 1 / -1; color: #68666d; text-align: center; }
.play-main { width: min(1440px, calc(100% - 24px)); margin: 0 auto; padding: 10px 0 24px; }
.play-stage {
  min-height: calc(100vh - 120px);
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 28px;
  background: #11121d;
  box-shadow: var(--shadow);
}
.play-stage iframe { width: 100%; height: calc(100vh - 120px); min-height: 640px; border: 0; background: #15162a; }
.play-message { width: min(560px, calc(100% - 32px)); color: #fff; text-align: center; }
.play-message h1 { margin: 0 0 14px; font-family: "Syne", sans-serif; font-size: clamp(2.2rem, 6vw, 4.2rem); line-height: .95; letter-spacing: -.055em; }
.play-message > p { color: rgba(255,255,255,.62); line-height: 1.7; }
.play-message .button-row { justify-content: center; }
.play-message .auth-tabs { color: var(--ink); }
.play-message .auth-form { margin-top: 20px; text-align: left; }
.play-message .auth-form label { color: rgba(255,255,255,.7); }
.admin-grid { display: grid; grid-template-columns: .75fr 1.25fr; gap: 24px; }
.admin-form { display: grid; gap: 18px; }
.qr-result { text-align: center; }
.qr-result img { width: min(100%, 390px); margin: 4px auto 22px; border: 12px solid #fff; border-radius: 22px; }
.result-meta { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; text-align: left; }
.result-meta div { padding: 14px; border-radius: 13px; background: #ebe7dc; }
.result-meta span, .result-url span { display: block; margin-bottom: 5px; color: #77737a; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.result-url { margin: 12px 0; padding: 14px; border-radius: 13px; background: #ebe7dc; text-align: left; overflow-wrap: anywhere; }
.play-main { width: min(1250px, calc(100% - 24px)); margin: 0 auto; padding: 16px 0 50px; }
.play-stage { overflow: hidden; min-height: 72vh; border: 1px solid rgba(255,255,255,.13); border-radius: 26px; background: #05060a; box-shadow: var(--shadow); }
.play-stage iframe { display: block; width: 100%; min-height: 72vh; border: 0; }
.play-message { max-width: 600px; margin: 12vh auto; padding: 30px; color: #fff; text-align: center; }
.play-message h1 { font-family: "Syne", sans-serif; font-size: 2.8rem; letter-spacing: -.05em; }
.play-message p { color: rgba(255,255,255,.6); line-height: 1.7; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .app-header { min-height: 74px; }
  .app-brand img { width: 138px; }
  .app-nav > a:not(.account-link) { display: none; }
  .app-main { padding-top: 18px; }
  .activation-layout, .admin-grid, .library-grid { grid-template-columns: 1fr; }
  .book-art { min-height: 330px; padding: 28px; }
  .book-art h1 { margin-top: 65px; }
  .activation-panel, .panel-card, .message-card { padding: 28px 22px; }
  .result-meta { grid-template-columns: 1fr; }
  .button-row .app-button { width: 100%; }
  .play-stage, .play-stage iframe { min-height: calc(100vh - 104px); height: calc(100vh - 104px); border-radius: 20px; }
}
