:root {
  --ink: #10201b;
  --muted: #66746f;
  --paper: #f7f3e7;
  --panel: #fffaf0;
  --line: #ded5bf;
  --green: #0f7b59;
  --blue: #1167b1;
  --red: #c94137;
  --gold: #d79b2b;
  --shadow: 0 18px 45px rgba(16, 32, 27, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(15, 123, 89, 0.18), transparent 34%),
    linear-gradient(225deg, rgba(17, 103, 177, 0.15), transparent 36%),
    var(--paper);
}

body.locked {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 25% 20%, rgba(243, 192, 92, 0.22), transparent 32%),
    linear-gradient(135deg, #10201b, #0f3a31);
}

.auth-screen.hidden {
  display: none;
}

.auth-card {
  display: grid;
  gap: 22px;
  width: min(460px, 100%);
  border: 1px solid rgba(255, 250, 240, 0.22);
  border-radius: 8px;
  background: #fffaf0;
  padding: 24px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
}

.auth-brand {
  color: var(--ink);
}

.auth-brand p {
  color: var(--green);
}

.auth-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.6rem);
  line-height: 0.95;
}

.auth-copy p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-form input,
.role-switch {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
}

.role-switch label {
  position: relative;
  display: grid;
  min-height: 36px;
  place-items: center;
  color: var(--ink);
  cursor: pointer;
}

.role-switch input {
  position: absolute;
  opacity: 0;
}

.role-switch span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border-radius: 6px;
}

.role-switch input:checked + span {
  background: #10201b;
  color: #fffaf0;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  background: #10201b;
  color: #f9f2dc;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.session-card {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(249, 242, 220, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  padding: 12px;
}

.session-card span {
  color: rgba(249, 242, 220, 0.68);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.session-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-card .ghost-action {
  min-height: 34px;
  background: rgba(255, 255, 255, 0.1);
  color: #fffaf0;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 72px;
  height: 58px;
  align-content: center;
  justify-items: start;
  border: 2px solid rgba(249, 242, 220, 0.6);
  border-radius: 8px;
  background:
    radial-gradient(circle at 84% 22%, rgba(255, 244, 162, 0.72), transparent 20%),
    linear-gradient(145deg, #0f7b59 0 56%, #d79b2b 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  overflow: hidden;
  padding: 8px;
}

.brand-mark span,
.brand-mark strong {
  position: relative;
  z-index: 2;
  color: #fffaf0;
  line-height: 1;
  text-transform: uppercase;
}

.brand-mark span {
  font-size: 0.62rem;
  font-weight: 900;
}

.brand-mark strong {
  font-size: 1.18rem;
  font-weight: 900;
}

.brand-mark i {
  position: absolute;
  right: 7px;
  top: 9px;
  width: 18px;
  height: 29px;
  border-radius: 46% 46% 30% 30%;
  background: linear-gradient(120deg, #fff4a2, #d3a13a 45%, #7d4d10);
  box-shadow:
    0 17px 0 -10px #0f3b2f,
    0 22px 0 -11px #f3c05c;
}

.brand-mark i::before,
.brand-mark i::after {
  content: "";
  position: absolute;
  top: 5px;
  width: 9px;
  height: 12px;
  border: 3px solid #d3a13a;
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
}

.brand-mark i::before {
  left: -7px;
  transform: rotate(-25deg);
}

.brand-mark i::after {
  right: -7px;
  transform: rotate(25deg);
}

.brand p,
.eyebrow,
.progress-panel span,
.wallet span,
.hero-stat span {
  margin: 0;
  color: rgba(249, 242, 220, 0.7);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand h1,
.topbar h2,
.section-head h3,
.shop-copy h3,
.hero-copy h3 {
  margin: 0;
}

.brand h1 {
  font-size: 1.35rem;
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.nav-tab,
.ghost-action,
.primary-action,
select {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.nav-tab {
  color: rgba(249, 242, 220, 0.78);
  background: rgba(255, 255, 255, 0.08);
  text-align: left;
  padding: 0 14px;
  font-weight: 700;
}

.nav-tab.active {
  color: #10201b;
  background: #f9f2dc;
}

.admin-tab {
  border-color: rgba(243, 192, 92, 0.42);
  color: #ffd782;
}

.wallet,
.progress-panel {
  border: 1px solid rgba(249, 242, 220, 0.2);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.wallet {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wallet strong {
  color: #ffd782;
  font-size: 1.8rem;
}

.primary-action {
  border-color: #f3c05c;
  background: #f3c05c;
  color: #10201b;
  padding: 0 16px;
  font-weight: 800;
}

.primary-action:disabled,
.ghost-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.wide {
  width: 100%;
}

.progress-panel {
  display: grid;
  gap: 12px;
}

.progress-panel > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-panel strong {
  font-size: 1.2rem;
}

.progress-panel p {
  margin: 0;
  color: rgba(249, 242, 220, 0.74);
  line-height: 1.45;
}

.meter {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f3c05c, #3fc288);
  transition: width 260ms ease;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar,
.section-head,
.showcase {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 18px;
}

.topbar .eyebrow {
  color: var(--green);
}

.topbar h2 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ghost-action {
  border-color: var(--line);
  background: rgba(255, 250, 240, 0.72);
  color: var(--ink);
  padding: 0 14px;
  font-weight: 800;
}

.ghost-action.danger {
  color: var(--red);
}

.showcase {
  overflow: hidden;
  margin-bottom: 24px;
  min-height: 470px;
  padding: 34px 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 40% 90%, rgba(16, 32, 27, 0.18), transparent 32%),
    linear-gradient(180deg, #fff 0%, #f4f7f5 100%);
  box-shadow: var(--shadow);
}

.brand-lockup {
  display: none;
}

.year-mark {
  position: relative;
  font-size: clamp(4rem, 8vw, 7.5rem);
  font-weight: 900;
  line-height: 0.78;
}

.year-mark::after {
  content: "";
  position: absolute;
  left: 36%;
  top: 16%;
  width: 0.18em;
  height: 0.44em;
  border-radius: 50% 50% 42% 42%;
  background: linear-gradient(120deg, #fff4a2, #c48922 48%, #7d4d10);
  box-shadow: 0 0.34em 0 -0.11em #0f7b59;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.28));
}

.brand-lockup strong {
  font-size: 1rem;
  font-weight: 900;
}

.brand-lockup span {
  font-size: 2rem;
  font-weight: 900;
  line-height: 0.9;
}

.hardcover {
  position: relative;
  width: min(36vw, 340px);
  min-width: 300px;
  aspect-ratio: 0.76;
  flex: 0 0 auto;
  margin-left: clamp(12px, 4vw, 70px);
  transform: perspective(1100px) rotateY(-9deg) rotateX(1deg);
  transform-style: preserve-3d;
  filter: drop-shadow(28px 34px 30px rgba(16, 32, 27, 0.18));
}

.hardcover::after {
  content: "";
  position: absolute;
  left: 18px;
  right: -18px;
  bottom: -16px;
  height: 22px;
  transform: skewX(-38deg);
  border-radius: 0 0 5px 5px;
  background:
    repeating-linear-gradient(0deg, #f9f2dc 0 3px, #d8c79a 3px 4px),
    #fff;
  box-shadow: 0 14px 26px rgba(16, 32, 27, 0.16);
}

.book-spine {
  position: absolute;
  inset: 0 auto 0 -38px;
  display: grid;
  width: 44px;
  place-items: center;
  border-radius: 5px 0 0 5px;
  background: linear-gradient(90deg, #111, #222);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  text-orientation: mixed;
  transform: rotateY(84deg);
  writing-mode: vertical-rl;
}

.book-cover {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: space-between;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  background:
    linear-gradient(100deg, rgba(0, 0, 0, 0.08) 0 8%, transparent 8%),
    linear-gradient(90deg, #f36b27 0 10%, transparent 10% 90%, #5064c8 90%),
    #fff;
  color: #111;
  grid-template-rows: auto 1fr auto auto;
  padding: 24px 34px 22px;
  box-shadow:
    inset 0 0 0 1px rgba(16, 32, 27, 0.12),
    inset 13px 0 16px rgba(0, 0, 0, 0.08);
}

.book-cover.has-cover-image {
  background:
    linear-gradient(90deg, rgba(16, 32, 27, 0.74), rgba(16, 32, 27, 0.16)),
    var(--cover-image) center / cover,
    #fff;
  color: #fff;
}

.book-cover.has-cover-image .cover-pattern {
  opacity: 0.22;
}

.book-cover.has-cover-image strong,
.book-cover.has-cover-image .cover-title,
.book-cover.has-cover-image span,
.book-cover.has-cover-image em {
  color: #fff;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
}

.cover-pattern {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 1% 14%, #2f72bd 0 12%, transparent 13%),
    radial-gradient(circle at 5% 28%, #f36b27 0 13%, transparent 14%),
    radial-gradient(circle at 2% 45%, #b9d846 0 14%, transparent 15%),
    radial-gradient(circle at 6% 64%, #69b866 0 13%, transparent 14%),
    radial-gradient(circle at 97% 14%, #a00820 0 13%, transparent 14%),
    radial-gradient(circle at 93% 34%, #5064c8 0 13%, transparent 14%),
    radial-gradient(circle at 99% 54%, #83b9df 0 13%, transparent 14%),
    radial-gradient(circle at 95% 76%, #ef3f2d 0 13%, transparent 14%);
}

.book-cover span,
.book-cover em {
  position: relative;
  z-index: 1;
  font-size: 1rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.book-cover span {
  justify-self: center;
}

.book-cover strong {
  position: relative;
  z-index: 1;
  color: #111;
  align-self: center;
  justify-self: center;
  margin-top: 18px;
  font-size: clamp(9.5rem, 18vw, 13.5rem);
  font-weight: 900;
  line-height: 0.68;
  text-transform: uppercase;
}

.cup-mark {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 2;
  transform: translate(-50%, -50%);
  width: clamp(86px, 8vw, 118px);
  height: clamp(150px, 14vw, 194px);
  background: transparent;
  box-shadow: none;
}

.cup-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 16px 14px rgba(0, 0, 0, 0.28));
}

.cup-mark::before,
.cup-mark::after {
  display: none;
}

.cover-title {
  position: relative;
  z-index: 2;
  justify-self: center;
  margin-top: -4px;
  color: #111;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  line-height: 0.88;
  text-align: center;
  text-transform: uppercase;
}

.hero-copy {
  max-width: 360px;
  flex: 1;
}

.hero-copy h3 {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  line-height: 1.02;
}

.hero-copy p,
.section-head p,
.shop-copy p,
.empty-state {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.hero-stat {
  display: grid;
  min-width: 126px;
  justify-items: end;
}

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

.hero-stat strong {
  font-size: 2.5rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  margin-bottom: 16px;
}

.section-head.compact {
  margin-bottom: 10px;
}

.pager-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pager-controls span {
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.86);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
}

select {
  border-color: var(--line);
  background: #fffaf0;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 700;
}

.album-table {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent),
    #8b5f3f;
  padding: 34px;
  box-shadow: inset 0 0 0 1px rgba(80, 47, 28, 0.26), var(--shadow);
}

.album-table::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 56px 100%,
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 100% 42px;
  opacity: 0.5;
}

.table-props {
  position: absolute;
  inset: auto 28px 18px auto;
  display: flex;
  gap: 12px;
  z-index: 4;
}

.loose-pack,
.loose-sticker {
  display: grid;
  place-items: center;
  transform: rotate(-7deg);
  border-radius: 6px;
  color: #fff;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 12px 24px rgba(35, 21, 13, 0.24);
}

.loose-pack {
  width: 96px;
  height: 132px;
  background: linear-gradient(150deg, #0f7b59 0 38%, #f3c05c 38% 62%, #1167b1 62%);
  font-size: 0.78rem;
}

.loose-sticker {
  width: 74px;
  height: 96px;
  align-self: end;
  transform: rotate(10deg);
  background: #fff;
  color: var(--green);
  border: 6px solid #f0eadb;
  font-size: 0.72rem;
}

.magazine {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 22px;
}

.spread {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 390px;
  border: 1px solid #c9bfa7;
  border-radius: 8px;
  background: #fff9ea;
  box-shadow: 0 22px 42px rgba(16, 32, 27, 0.16);
}

.page-turn {
  animation: pageTurn 260ms ease both;
  transform-origin: center;
}

@keyframes pageTurn {
  from {
    opacity: 0.45;
    transform: perspective(1200px) rotateY(-7deg) translateX(16px);
  }

  to {
    opacity: 1;
    transform: perspective(1200px) rotateY(0) translateX(0);
  }
}

body[data-role="admin"] .showcase,
body[data-role="admin"] .wallet,
body[data-role="admin"] #dailyBonus,
body[data-role="admin"] .progress-panel,
body[data-role="admin"] #autoStick {
  display: none;
}

body[data-role="admin"] .top-actions {
  justify-content: flex-end;
}

.spread::before,
.spread::after {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  width: 24px;
  pointer-events: none;
  z-index: 2;
}

.spread::before {
  left: calc(50% - 24px);
  background: linear-gradient(90deg, transparent, rgba(54, 42, 24, 0.12));
}

.spread::after {
  right: calc(50% - 24px);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.44), transparent);
}

.fold {
  position: absolute;
  inset: 0 auto 0 50%;
  width: 1px;
  background: rgba(119, 101, 70, 0.28);
  z-index: 3;
}

.page-number {
  position: absolute;
  right: 14px;
  top: 10px;
  z-index: 4;
  color: #9a8c70;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.team-page {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-width: 0 1px 0 0;
  border-radius: 0;
  background:
    linear-gradient(rgba(16, 32, 27, 0.035) 1px, transparent 1px) 0 0 / 100% 28px,
    radial-gradient(circle at 92% 90%, rgba(244, 210, 42, 0.88) 0 22%, transparent 23%),
    linear-gradient(135deg, #ffffff 0 22%, #0d9a57 22% 58%, #1b63ad 58%);
  padding: 16px;
}

.custom-page {
  background:
    linear-gradient(rgba(16, 32, 27, 0.035) 1px, transparent 1px) 0 0 / 100% 28px,
    radial-gradient(circle at 92% 90%, color-mix(in srgb, var(--page-accent) 76%, transparent) 0 22%, transparent 23%),
    linear-gradient(135deg, #fffdf3 0 22%, var(--page-primary) 22% 58%, var(--page-secondary) 58%);
}

.custom-filled {
  transform: rotate(-0.7deg);
}

.team-page:nth-child(3) {
  border-right: 0;
}

.blank-page {
  display: grid;
  place-items: center;
  color: #a09378;
  font-weight: 900;
  text-transform: uppercase;
}

.team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 0 12px;
  border-bottom: 0;
}

.team-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.flag {
  display: grid;
  width: 38px;
  height: 28px;
  place-items: center;
  border-radius: 4px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  font-size: 1.25rem;
}

.team-name h4,
.team-name p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-name h4 {
  color: #fff;
  font-size: clamp(1.2rem, 2vw, 1.9rem);
  text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

.team-name p,
.page-count {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  font-weight: 700;
}

.page-rule {
  height: 7px;
  margin: 8px 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
}

.team-info,
.group-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  margin-bottom: 8px;
  color: #fff;
  font-weight: 900;
}

.team-info {
  flex-wrap: wrap;
}

.team-info span:last-child,
.group-info span {
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.22);
  padding: 5px 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.mini-flag {
  display: grid;
  width: 42px;
  height: 30px;
  place-items: center;
  border-radius: 4px;
  background: #fff;
  font-size: 1.2rem;
}

.group-info strong {
  margin-right: auto;
  font-size: 1.05rem;
  text-transform: uppercase;
}

.sticker-slots {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  padding: 0;
}

.slot,
.sticker-card {
  aspect-ratio: 3 / 4;
  min-width: 0;
  border-radius: 7px;
}

.slot {
  display: grid;
  place-items: center;
  border: 1px dashed #b8ad94;
  background:
    linear-gradient(135deg, rgba(16, 32, 27, 0.055) 25%, transparent 25%) 0 0 / 12px 12px,
    rgba(255, 255, 255, 0.86);
  color: #5b8872;
  font-weight: 800;
  padding: 8px;
  text-align: center;
}

.slot span,
.slot strong {
  display: block;
}

.slot span {
  font-size: 0.68rem;
}

.slot strong {
  font-size: 0.78rem;
  text-transform: uppercase;
}

.slot.filled {
  border-style: solid;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(16, 32, 27, 0.12);
  padding: 0;
  transform: rotate(-1deg);
}

.sticker-face {
  display: grid;
  height: 100%;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  border-radius: inherit;
  border: 2px solid transparent;
  background: #fff;
}

.sample-sticker {
  border-color: #f4c84a;
  box-shadow: inset 0 0 0 3px rgba(244, 200, 74, 0.24);
}

.sticker-art {
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.85) 0 15%, transparent 16%),
    linear-gradient(155deg, var(--accent), #fff 72%);
  font-size: 1.55rem;
}

.sample-sticker .sticker-art {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent),
    radial-gradient(circle at 50% 30%, #f5c9a6 0 13%, transparent 14%),
    linear-gradient(150deg, #ffde58 0 48%, #18a45c 48%);
}

.player-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.sample-sticker .player-photo {
  filter: saturate(1.08) contrast(1.04);
}

.portrait {
  display: grid;
  width: 54%;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(#f1c49d 0 42%, #f3df3e 42% 70%, #1f8c4f 70%);
  box-shadow: 0 4px 10px rgba(16, 32, 27, 0.18);
  font-size: 0.95em;
}

.role-icon {
  position: absolute;
  right: 8%;
  bottom: 10%;
  display: grid;
  width: 28%;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(16, 32, 27, 0.14);
  font-size: 0.82em;
}

.sample-sticker .role-icon {
  right: 6px;
  bottom: 6px;
  width: 30%;
  border: 2px solid #ffde58;
  color: var(--green);
  font-size: 0.7em;
}

.sticker-meta {
  padding: 5px;
  background: #fff;
  text-align: center;
}

.sticker-meta strong,
.sticker-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticker-meta strong {
  font-size: 0.68rem;
}

.sticker-meta span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 700;
}

.rare .sticker-face {
  border-color: #d79b2b;
}

.page-footer {
  margin-top: auto;
  padding-top: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.7rem;
  font-weight: 900;
  text-align: right;
  text-transform: uppercase;
}

.shop-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 16px;
}

.shop-panel,
.reveal-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.86);
  padding: 18px;
  box-shadow: 0 12px 30px rgba(16, 32, 27, 0.08);
}

.pack-visual {
  display: grid;
  min-height: 360px;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), transparent 34%),
    linear-gradient(160deg, #0f7b59 0 40%, #f3c05c 40% 63%, #1167b1 63%);
  color: #fff;
  text-align: center;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.pack-top,
.pack-bottom {
  font-weight: 900;
  text-transform: uppercase;
}

.pack-ball {
  display: grid;
  width: 128px;
  height: 128px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 4rem;
}

.shop-copy {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.opened-pack,
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}

.sticker-card {
  position: relative;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 20px rgba(16, 32, 27, 0.1);
}

.sticker-card .sticker-art {
  font-size: 2.35rem;
}

.sticker-card .sticker-meta {
  padding: 8px;
}

.sticker-card .sticker-meta strong {
  font-size: 0.82rem;
}

.sticker-card .sticker-meta span {
  font-size: 0.68rem;
}

.badge {
  position: absolute;
  top: 7px;
  right: 7px;
  border-radius: 999px;
  background: #10201b;
  color: #fffaf0;
  padding: 3px 7px;
  font-size: 0.7rem;
  font-weight: 900;
}

.new-badge {
  left: 7px;
  right: auto;
  background: var(--green);
}

.stack-summary {
  color: var(--muted);
  font-weight: 800;
}

.market-layout,
.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.market-panel,
.admin-form,
.admin-results,
.prize-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.88);
  padding: 18px;
  box-shadow: 0 12px 30px rgba(16, 32, 27, 0.08);
}

.market-panel h3,
.prize-panel h3 {
  margin: 0 0 14px;
}

.market-grid {
  display: grid;
  gap: 10px;
}

.market-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  border: 1px solid rgba(222, 213, 191, 0.9);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.market-item .sticker-face {
  width: 62px;
  aspect-ratio: 3 / 4;
}

.market-item strong,
.market-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.market-item .primary-action,
.market-item .ghost-action {
  min-height: 36px;
  white-space: nowrap;
}

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

.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-form label:nth-child(1),
.admin-form label:nth-child(2),
.form-note {
  grid-column: span 2;
}

.form-note {
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  background: rgba(243, 192, 92, 0.16);
  color: #5f5234;
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.4;
}

.admin-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
}

.admin-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  font: inherit;
  font-weight: 800;
}

.file-label input {
  padding: 8px;
}

.sticker-builder {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.88);
  padding: 18px;
  box-shadow: 0 12px 30px rgba(16, 32, 27, 0.08);
}

.custom-sticker-form {
  display: grid;
  grid-template-columns: 1fr 1fr 120px 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

body[data-role="franqueado"] .layout-control,
body[data-role="franqueado"] .form-note {
  display: none;
}

.builder-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.custom-sticker-form label,
.file-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.custom-sticker-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  font: inherit;
  font-weight: 800;
}

.custom-sticker-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.custom-sticker-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(222, 213, 191, 0.9);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.custom-thumb {
  display: grid;
  width: 54px;
  height: 68px;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: #edf4f1;
  font-size: 1.4rem;
}

.custom-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.custom-sticker-row strong,
.custom-sticker-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-sticker-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.custom-sticker-row .ghost-action {
  min-height: 34px;
}

.admin-results {
  display: grid;
  gap: 14px;
}

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

.result-card {
  border: 1px solid rgba(222, 213, 191, 0.9);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.result-card.highlight {
  background:
    radial-gradient(circle at 88% 20%, rgba(243, 192, 92, 0.36), transparent 30%),
    #10201b;
  color: #fffaf0;
}

.result-card span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.result-card.highlight span {
  color: rgba(255, 250, 240, 0.7);
}

.result-card strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.result-card p {
  margin: 6px 0 0;
  color: inherit;
  opacity: 0.78;
}

.prize-panel {
  box-shadow: none;
}

.prize-panel ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.prize-panel li {
  border-radius: 6px;
  background: rgba(15, 123, 89, 0.09);
  padding: 10px;
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  transform: translateY(24px);
  border-radius: 8px;
  background: #10201b;
  color: #fffaf0;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 860px) {
  .app-shell,
  .shop-layout,
  .market-layout,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .nav-tabs {
    grid-template-columns: repeat(5, 1fr);
  }

  .nav-tab {
    text-align: center;
  }

  .topbar,
  .section-head,
  .showcase {
    align-items: stretch;
    flex-direction: column;
  }

  .hardcover {
    width: min(70vw, 360px);
    margin-inline: auto;
  }

  .hero-stat {
    justify-items: start;
  }
}

@media (max-width: 520px) {
  .main,
  .sidebar {
    padding: 16px;
  }

  .showcase,
  .album-table {
    padding: 16px;
  }

  .table-props {
    display: none;
  }

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

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

  .admin-form,
  .result-grid,
  .custom-sticker-form {
    grid-template-columns: 1fr;
  }

  .admin-form label:nth-child(1),
  .admin-form label:nth-child(2),
  .form-note {
    grid-column: auto;
  }

  .market-item {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .market-item button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .spread {
    grid-template-columns: 1fr;
  }

  .spread::before,
  .spread::after,
  .fold {
    display: none;
  }

  .team-page {
    border-width: 0 0 1px;
  }

  .team-page:last-child {
    border-bottom: 0;
  }
}
