/* AMYJANE x Pavel redemption system */

:root {
  --pink: #f4a8c5;
  --pink-soft: #fbd4e2;
  --pink-edge: #e94f88;
  --mint: #b9d8b6;
  --mint-soft: #d5e9c9;
  --mint-dark: #3f6b4d;
  --cream: #f5efe1;
  --cream-soft: #faf6ec;
  --ink: #202820;
  --ink-soft: #566056;
  --ink-mute: #879083;
  --hairline: rgba(43, 51, 45, .12);
  --bg-from: #e5f1d9;
  --bg-to: #82b78f;
  --theme-deep: #719f77;
  --radius-card: 28px;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(.22,.61,.36,1);
  --ease-bouncy: cubic-bezier(.34,1.56,.64,1);
  --shadow-card: 0 30px 82px -44px rgba(43,51,45,.78);
}

body[data-theme="periwinkle"] { --bg-from: #dce4ff; --bg-to: #8193d3; --theme-deep: #6f82ca; }
body[data-theme="mint"] { --bg-from: #e5f1d9; --bg-to: #82b78f; --theme-deep: #719f77; }
body[data-theme="cloud"] { --bg-from: #ffe2ec; --bg-to: #ee82ab; --theme-deep: #dc6d99; }
body[data-theme="blush"] { --bg-from: #ffe5ee; --bg-to: #eca6bd; --theme-deep: #d989a5; }
body[data-theme="pistachio"] { --bg-from: #ecf5dc; --bg-to: #abc984; --theme-deep: #91ad6e; }

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100svh;
  font-family: Inter, "Noto Sans SC", "Noto Sans Thai", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -16%, rgba(255,255,255,.80) 0%, rgba(255,255,255,.18) 36%, rgba(255,255,255,0) 60%),
    linear-gradient(155deg, rgba(255,255,255,.36) 0%, rgba(255,255,255,0) 30%),
    linear-gradient(180deg, var(--bg-from) 0%, var(--bg-to) 100%);
  overflow-x: hidden;
  transition: background .35s var(--ease-out);
}

body.has-sheet {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.experience {
  width: min(100%, 460px);
  margin: 0 auto;
  padding: 18px 20px 36px;
}

.xp-top {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: fade-drop .45s var(--ease-out) both;
}

.brand,
.brand__mark {
  display: inline-flex;
  align-items: center;
}

.brand__mark {
  gap: 8px;
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,.48);
  color: var(--ink);
  background: rgba(255,255,255,.68);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-decoration: none;
  box-shadow: 0 12px 28px -22px rgba(0,0,0,.55);
}

.brand__mark strong {
  font-size: 11px;
  letter-spacing: .34em;
}

.brand__mark span {
  font-size: 11px;
  letter-spacing: .24em;
  opacity: .84;
}

.top-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chip,
.lang-select {
  height: 34px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,.56);
  color: var(--ink);
  background: rgba(255,255,255,.70);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 12px 26px -22px rgba(0,0,0,.55);
}

.lang-select {
  width: 82px;
  outline: none;
}

.landing {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 22px;
  padding: 72px 0 34px;
  animation: page-rise .55s var(--ease-out) .05s both;
}

.landing__copy {
  color: var(--ink);
}

.eyebrow {
  margin: 0 0 8px;
  color: color-mix(in srgb, var(--theme-deep) 70%, #1d281e);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.landing .eyebrow,
.sheet__head .eyebrow {
  color: var(--theme-deep);
}

.landing h1 {
  margin: 0 0 12px;
  font-family: "Playfair Display", serif;
  font-size: clamp(40px, 12vw, 58px);
  line-height: .95;
  letter-spacing: 0;
}

.landing p:not(.eyebrow) {
  margin: 0;
  max-width: 330px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.55;
}

.landing__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.button {
  min-height: 50px;
  border-radius: var(--radius-pill);
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: #202821;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  box-shadow: 0 18px 36px -20px rgba(43,51,45,.82);
}

.button--soft {
  color: var(--ink);
  background: rgba(255,255,255,.76);
}

.empty-state {
  margin-top: 0;
  animation: page-rise .55s var(--ease-out) .18s both;
}

.empty-card {
  width: 100%;
  min-height: 128px;
  display: grid;
  gap: 6px;
  place-items: center;
  text-align: center;
  border-radius: var(--radius-card);
  border: 1px solid rgba(255,255,255,.58);
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(250,246,236,.94));
  box-shadow: var(--shadow-card);
}

.empty-card span {
  font-size: 18px;
  font-weight: 900;
}

.empty-card small {
  max-width: 250px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.collection {
  display: grid;
  gap: 18px;
  padding-top: 24px;
  animation: page-rise .45s var(--ease-out) both;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.section-head h2 {
  margin: 0;
  color: #fff;
  font-family: "Playfair Display", serif;
  font-size: 38px;
  line-height: 1;
  text-shadow: 0 14px 42px rgba(43,51,45,.18);
}

.collection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.collection-card {
  position: relative;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.56);
  background: rgba(255,255,255,.70);
  box-shadow: var(--shadow-card);
  isolation: isolate;
  transform: translateZ(0);
  transition: transform .28s var(--ease-out), box-shadow .28s var(--ease-out);
}

.collection-card--hero {
  grid-column: 1 / -1;
  border-radius: 30px;
}

.collection-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 34px 86px -38px rgba(43,51,45,.80);
}

.collection-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0) 42%, rgba(18,25,19,.72) 100%);
  pointer-events: none;
}

.collection-card img {
  display: block;
  width: 100%;
  transition: transform .45s var(--ease-out);
}

.collection-card:hover img {
  transform: scale(1.035);
}

.collection-card__meta,
.collection-card strong {
  position: absolute;
  left: 15px;
  right: 15px;
  z-index: 2;
  color: #fff;
  text-align: left;
}

.collection-card__meta {
  bottom: 46px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .82;
}

.collection-card strong {
  bottom: 15px;
  font-size: 13px;
  line-height: 1.25;
  text-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.collection-card--hero strong {
  max-width: 78%;
  font-size: 21px;
}

.player-view {
  display: grid;
  gap: 16px;
  padding-top: 18px;
  animation: page-rise .42s var(--ease-out) both;
}

.back-link {
  justify-self: start;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  color: var(--ink);
  background: rgba(255,255,255,.74);
  font-size: 12px;
  font-weight: 900;
}

.poster-large {
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,.58);
  background: rgba(255,255,255,.40);
  box-shadow: var(--shadow-card);
}

.poster-large img {
  width: 100%;
  display: block;
}

.player-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-card);
  border: 1px solid rgba(255,255,255,.62);
  background: linear-gradient(180deg, rgba(255,255,255,.90), rgba(250,246,236,.96));
  box-shadow: var(--shadow-card);
}

.player__volume {
  margin: 0 0 5px;
  color: var(--theme-deep);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .28em;
  text-transform: uppercase;
}

.player__title {
  margin: 0;
  font-family: "Playfair Display", "Noto Sans SC", serif;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

.big-play {
  justify-self: center;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: radial-gradient(115% 115% at 30% 22%, #fff 0%, var(--mint-soft) 28%, var(--mint) 58%, var(--theme-deep) 100%);
  box-shadow: 0 26px 48px -22px rgba(63,107,77,.66);
  transition: transform .24s var(--ease-bouncy);
}

.big-play:active {
  transform: scale(.96);
}

.play-icon {
  width: 0;
  height: 0;
  margin-left: 5px;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 19px solid currentColor;
}

.big-play.is-playing .play-icon {
  width: 22px;
  height: 24px;
  margin-left: 0;
  border: 0;
  background:
    linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65% 100%);
}

.seek-row {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 10px;
  color: var(--ink-mute);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.range {
  width: 100%;
  accent-color: var(--theme-deep);
}

.message {
  min-height: 22px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.message.is-error {
  color: #a8385c;
}

.complete {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  color: var(--mint-dark);
  line-height: 1.5;
  font-size: 13px;
  box-shadow: 0 20px 44px -36px rgba(43,51,45,.65);
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
  pointer-events: none;
}

.sheet.is-open {
  pointer-events: auto;
}

.sheet__shade {
  position: absolute;
  inset: 0;
  background: rgba(16,25,18,.34);
  opacity: 0;
  transition: opacity .25s var(--ease-out);
}

.sheet.is-open .sheet__shade {
  opacity: 1;
}

.sheet__panel {
  position: relative;
  width: min(100%, 460px);
  margin: 0 auto;
  padding: 24px 20px max(24px, env(safe-area-inset-bottom));
  border-radius: 30px 30px 0 0;
  border: 1px solid rgba(255,255,255,.70);
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(250,246,236,.98));
  box-shadow: 0 -28px 70px -36px rgba(20,28,22,.68);
  transform: translateY(105%);
  transition: transform .32s var(--ease-out);
}

.sheet.is-open .sheet__panel {
  transform: translateY(0);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  pointer-events: none;
}

.modal.is-open {
  pointer-events: auto;
}

.modal__shade {
  position: absolute;
  inset: 0;
  background: rgba(16,25,18,.38);
  opacity: 0;
  transition: opacity .25s var(--ease-out);
}

.modal.is-open .modal__shade {
  opacity: 1;
}

.modal__panel {
  position: relative;
  width: min(100%, 380px);
  display: grid;
  gap: 14px;
  padding: 28px 22px 22px;
  border-radius: var(--radius-card);
  border: 1px solid rgba(255,255,255,.72);
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(250,246,236,.98));
  box-shadow: 0 34px 90px -42px rgba(20,28,22,.76);
  transform: translateY(18px) scale(.96);
  opacity: 0;
  transition: opacity .26s var(--ease-out), transform .26s var(--ease-bouncy);
}

.modal.is-open .modal__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal__panel h2 {
  margin: 0;
  font-family: "Playfair Display", "Noto Sans SC", serif;
  font-size: 31px;
  line-height: 1.08;
}

.modal__panel p {
  margin: 0;
}

.modal__panel > p:not(.eyebrow) {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}

.gift-contact {
  padding: 12px 14px;
  border-radius: 16px;
  color: var(--ink);
  background: rgba(127,177,138,.16);
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.sheet__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(43,51,45,.08);
  font-weight: 900;
}

.sheet__head {
  padding-right: 44px;
  margin-bottom: 16px;
}

.sheet__head .eyebrow {
  color: var(--theme-deep);
}

.sheet__head h2 {
  margin: 0 0 8px;
  font-family: "Playfair Display", "Noto Sans SC", serif;
  font-size: 31px;
  line-height: 1.08;
}

.sheet__head p:not(.eyebrow) {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.form {
  display: grid;
  gap: 13px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(43,51,45,.14);
  border-radius: 16px;
  background: rgba(255,255,255,.86);
  color: var(--ink);
  outline: none;
}

.field input,
.field select {
  height: 48px;
  padding: 0 14px;
}

.field textarea {
  min-height: 108px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.45;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(63,107,77,.44);
  box-shadow: 0 0 0 4px rgba(127,177,138,.16);
}

.toggle-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
}

/* Admin */
.admin-shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 20px;
}

.admin-topbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: start;
}

.admin-side,
.admin-main {
  display: grid;
  gap: 16px;
}

.admin-title {
  color: #fff;
  margin: 0 0 18px;
}

.admin-title h1 {
  margin: 0 0 6px;
  font-size: 32px;
}

.admin-title p {
  margin: 0;
  color: rgba(255,255,255,.92);
}

.panel,
.login-panel {
  border-radius: var(--radius-card);
  border: 1px solid rgba(255,255,255,.58);
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(250,246,236,.95));
  box-shadow: var(--shadow-card);
  padding: 22px;
  margin-bottom: 16px;
}

.login-panel {
  width: min(100%, 420px);
}

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading h2 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.2;
}

.panel-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.form-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

.admin-actions .button {
  flex: 1 1 auto;
  min-width: 92px;
}

.generated-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.generated-item {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-top: 1px solid var(--hairline);
}

.generated-item strong,
td code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.generated-item span,
.note,
td span {
  display: block;
  color: var(--ink-mute);
  font-size: 12px;
  line-height: 1.35;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.70);
}

.stat span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  font-size: 24px;
  margin-top: 4px;
}

.admin-table-panel {
  margin-bottom: 0;
}

.table-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 12px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  font-size: 13px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(43,51,45,.08);
  font-size: 11px;
  font-weight: 700;
}

.tag--redeemed {
  color: #fff;
  background: var(--theme-deep);
}

.tag--disabled {
  color: #fff;
  background: #9b4a5f;
}

.status-select {
  height: 34px;
  min-width: 104px;
  border: 1px solid rgba(43,51,45,.12);
  border-radius: 12px;
  padding: 0 8px;
  background: rgba(255,255,255,.82);
  color: var(--ink);
}

@keyframes page-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-drop {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 760px) {
  .experience {
    width: min(100%, 520px);
  }

  .poster-large,
  .player-panel,
  .empty-card {
    width: 420px;
    justify-self: center;
  }
}

@media (max-width: 760px) {
  .admin-shell {
    padding: 16px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .form-split,
  .summary {
    grid-template-columns: 1fr;
  }

  .table-head {
    display: grid;
  }
}

@media (max-width: 380px) {
  .experience {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand__mark span {
    display: none;
  }

  .landing__actions {
    grid-template-columns: 1fr;
  }
}
