/* Referral tab (recreation; decisão do time, 2026-10-16): layout of the approved mockup on the game's
   panels (play.css .content-panel #344E76, .btn-game) and fonts. Everything is scoped to .referral-page,
   except the NEW badge of the menu and the history row of a free box. */

/* ---- menu: NEW badge ---- */
.nav-new {
  display: inline-block;
  vertical-align: 6px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 4px;
  background: #EA5C5C;
  color: #FFF2DE;
  font: 700 10px/16px 'Saira Semi Condensed', sans-serif;
  letter-spacing: 0.06em;
  text-shadow: none;
}

/* ---- history: the free box (a 'referral_box' transaction, value 0) ---- */
.type.referral_box {
  font-family: Saira, sans-serif;
  font-style: normal;
  font-weight: bold;
  font-size: 20px;
  line-height: 24px;
  color: #A8E26E;
}
.transaction-icon.referral_box .status.success {
  background-image: url(/img/transactions/checkmark.png);
  background-size: cover;
}
.transaction-icon img.referral_box {
  top: 45% !important;
  content: url(/img/transactions/box.png);
}

/* ---- page ---- */
.referral-page {
  --ref-panel: #344E76;
  --ref-panel-hi: #3D5C8A;
  --ref-panel-row: #2F486E;
  --ref-well: #2A3B55;
  --ref-ink: #FFF2DE;
  --ref-ink-muted: #B9C5D8;
  --ref-ink-dim: #8798B4;
  --ref-cyan: #6ECDE2;
  --ref-cyan-deep: #2B79A7;
  --ref-yellow: #FDBF47;
  --ref-yellow-soft: #FDE39B;
  --ref-green: #87C847;
  --ref-green-soft: #A8E26E;
  --ref-green-ink: #23400F;
  --ref-green-edge: #5E8F2E;
  --ref-red: #EA5C5C;
  --ref-outline: #1B2536;
  --ref-chip-ink: #1E2A3A;
  --ref-wood: #4B3B30;
  --ref-wood-edge: #B98348;
  --ref-wood-dark: #6E4A26;
  --ref-hl: rgba(255, 255, 255, 0.3);
  --ref-lowlight: rgba(0, 0, 0, 0.1);
  --ref-inset: rgba(0, 0, 0, 0.25);
  --ref-shadow: rgba(0, 0, 0, 0.3);
  --ref-drop: rgba(0, 0, 0, 0.18);
  color: var(--ref-ink);
  font-family: Lexend, sans-serif;
  padding-bottom: 56px;
}
.referral-page p { margin: 0; }
.referral-page h1, .referral-page h2, .referral-page h3 { margin: 0; }
.referral-page .ref-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ref-page { display: grid; gap: 24px; }
.ref-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@media (min-width: 992px) { .ref-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }

.ref-ico { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---- banner ---- */
.ref-hero {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--ref-drop);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: center;
  gap: 24px;
  padding: 40px 44px;
  background:
    radial-gradient(circle at 84% 42%, rgba(110, 205, 226, 0.22) 0, transparent 40%),
    linear-gradient(155deg, var(--ref-panel-hi) 0%, var(--ref-panel) 55%, var(--ref-well) 100%);
}
.ref-hero-copy { position: relative; z-index: 1; display: grid; gap: 16px; justify-items: start; min-width: 0; }
.ref-eyebrow {
  display: flex; align-items: center; gap: 8px;
  font: 700 15px/1 'Saira Semi Condensed', sans-serif; letter-spacing: 0.16em; color: var(--ref-cyan); text-transform: uppercase;
}
.ref-eyebrow img { width: 24px; height: 24px; }
.ref-hero h1 { font: 800 clamp(32px, 5.2vw, 56px)/1.04 Saira, sans-serif; color: var(--ref-ink); text-shadow: 3px 3px 0 #1E3354; }
.ref-hero h1 span { display: block; color: var(--ref-yellow); }
.ref-hero-text { max-width: 54ch; font-size: 17px; }
.ref-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px 7px; border-radius: 16px;
  background: var(--ref-green-soft); color: var(--ref-green-ink); border: 1px solid var(--ref-green-edge);
  box-shadow: inset 1px 3px 0 var(--ref-hl), inset 1px -2px 0 var(--ref-inset);
  font: 800 16px/1.25 Saira, sans-serif;
}
.ref-pill svg { width: 18px; height: 18px; flex: none; }
.ref-pill-check { fill: none; stroke: var(--ref-green-ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ref-hero-art { position: relative; display: grid; justify-items: center; }
.ref-gift-big { width: 210px; height: auto; aspect-ratio: 200 / 210; max-width: 100%; animation: ref-float 4.5s ease-in-out infinite; }
.ref-ribbon-wrap { position: relative; margin-top: -26px; z-index: 1; }
.ref-ribbon-wrap::before, .ref-ribbon-wrap::after {
  content: ""; position: absolute; top: 10px; width: 30px; height: calc(100% - 2px); background: #1F4E79; z-index: 0;
}
.ref-ribbon-wrap::before { left: -20px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 34% 50%); }
.ref-ribbon-wrap::after { right: -20px; clip-path: polygon(0 0, 100% 0, 66% 50%, 100% 100%, 0 100%); }
.ref-ribbon {
  position: relative; z-index: 1; display: block; padding: 9px 24px 10px;
  background: var(--ref-panel); border: 3px solid var(--ref-outline);
  box-shadow: inset 0 0 0 3px var(--ref-panel), inset 0 0 0 5px var(--ref-cyan);
  font: 800 24px/1 Saira, sans-serif; color: var(--ref-yellow-soft); letter-spacing: 0.04em;
  text-shadow: 2px 2px 0 var(--ref-shadow); white-space: nowrap;
}
@media (max-width: 860px) {
  .ref-hero { grid-template-columns: minmax(0, 1fr); padding: 28px 22px 30px; gap: 18px; }
  .ref-hero-art { order: -1; justify-self: start; margin-left: 18px; }
  .ref-gift-big { width: 130px; }
  .ref-ribbon { font-size: 18px; padding: 7px 18px 8px; }
  .ref-ribbon-wrap { margin-top: -18px; }
  .ref-hero-text { font-size: 16px; }
  .ref-pill { font-size: 14.5px; }
}

/* gift box drawing. The drawings in <symbol> reach the page through <use>, whose copies sit in a
   shadow tree: their rules cannot hang on .referral-page, so the class names carry the ref- prefix. */
.ref-gb-top { fill: #FFD66E; }
.ref-gb-left { fill: var(--ref-yellow); }
.ref-gb-right { fill: #E09A22; }
.ref-gb-rib { fill: var(--ref-red); }
.ref-gb-rib-d { fill: #C64444; }
.ref-gb-rib-l { fill: #F27B7B; }
.ref-gb-shine { fill: none; stroke: #FFF0C2; stroke-width: 3; stroke-linecap: round; opacity: 0.8; }
.ref-gb-line { fill: none; stroke: var(--ref-outline); stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; }
.ref-gb-bow { fill: #F27B7B; stroke: var(--ref-outline); stroke-width: 4; stroke-linejoin: round; }
.ref-gb-knot { fill: var(--ref-red); stroke: var(--ref-outline); stroke-width: 4; }
.ref-gb-shadow { fill: var(--ref-outline); opacity: 0.35; }
.ref-gb-spark { fill: #FFFFFF; }

/* ---- cards (play.css .content-panel with a dashed title row) ---- */
.referral-page .ref-panel { padding: 0; box-shadow: 4px 4px 0 var(--ref-drop); min-width: 0; }
.ref-panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 30px; border-bottom: 1px dashed var(--ref-cyan); }
.ref-panel-head h2 { flex: 1; min-width: 0; font: 800 26px/1.2 Saira, sans-serif; text-transform: uppercase; color: var(--ref-ink); }
.ref-oct { width: 45px; height: 45px; flex: none; }
.ref-oct-edge { fill: var(--ref-wood-edge); stroke: var(--ref-wood-dark); stroke-width: 1.5; }
.ref-oct-face { fill: var(--ref-wood); }
.referral-page .glyph { fill: var(--ref-ink); }
.referral-page .glyph-s { fill: none; stroke: var(--ref-ink); stroke-width: 3; }
.referral-page .glyph-cut { fill: var(--ref-wood); }
.ref-panel-body { padding: 22px 30px 30px; display: grid; gap: 18px; }
@media (max-width: 575.98px) {
  .ref-panel-head { padding: 12px 16px; gap: 10px; }
  .ref-panel-head h2 { font-size: 18px; }
  .ref-oct { width: 36px; height: 36px; }
  .ref-panel-body { padding: 18px 16px 20px; gap: 16px; }
}

/* buttons: play.css .btn-game with the mockup's padding and icons */
.referral-page .ref-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 20px; line-height: 1.2; text-transform: uppercase;
  border-radius: 10px; padding: 8px 22px 11px; white-space: nowrap;
}
.referral-page .ref-btn svg { width: 18px; height: 18px; flex: none; filter: drop-shadow(1px 1px 0 var(--ref-shadow)); }
.referral-page .ref-btn-blue { background: var(--ref-cyan-deep); box-shadow: inset 0 2px 0 var(--ref-hl), inset 0 -5px 0 var(--ref-lowlight); }
.referral-page .ref-btn[aria-busy="true"] svg { animation: ref-spin 0.7s linear infinite; }

/* ---- your next box ---- */
.ref-counter { margin-left: auto; font: 800 32px/1 Saira, sans-serif; color: var(--ref-yellow); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ref-counter .ref-of { color: var(--ref-ink-muted); font-size: 22px; }
@media (max-width: 575.98px) { .ref-counter { font-size: 24px; } .ref-counter .ref-of { font-size: 17px; } }

.ref-slots { list-style: none; margin: 0; padding: 6px 6px 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ref-slot {
  position: relative; aspect-ratio: 1; max-width: 100%; border-radius: 12px;
  border: 2px dashed var(--ref-ink-dim); background: var(--ref-well); box-shadow: inset 3px 3px 0 var(--ref-inset);
  display: grid; place-items: center;
}
.ref-slot-n { position: absolute; left: 8px; bottom: 5px; font: 700 14px/1 'Saira Semi Condensed', sans-serif; color: var(--ref-ink-dim); font-variant-numeric: tabular-nums; }
.ref-slot.is-qualified {
  border: 2px solid var(--ref-cyan);
  background: linear-gradient(160deg, var(--ref-cyan-deep), var(--ref-panel-hi));
  box-shadow: inset 0 2px 0 var(--ref-hl), inset 0 -4px 0 var(--ref-inset);
  animation: ref-slot-in 0.45s cubic-bezier(.2, .9, .3, 1.3) both;
  animation-delay: calc(var(--i) * 70ms);
}
.ref-slot.is-qualified .ref-slot-n { color: var(--ref-ink); }
.ref-slot-plane { width: 60%; height: auto; aspect-ratio: 1; }
.ref-slot-check {
  position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--ref-green); border: 2px solid var(--ref-outline); display: grid; place-items: center;
}
.ref-slot-check svg { width: 14px; height: 14px; }
.ref-slot-check path { fill: none; stroke: var(--ref-ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ref-slot.is-pending { border-color: var(--ref-yellow); }
.ref-slot-wait { width: 36%; height: auto; aspect-ratio: 1; color: var(--ref-yellow-soft); }
@media (max-width: 575.98px) {
  .ref-slots { gap: 7px; padding: 5px 5px 0 0; }
  .ref-slot { border-radius: 9px; }
  .ref-slot-n { font-size: 11px; left: 5px; bottom: 3px; }
  .ref-slot-check { width: 19px; height: 19px; top: -6px; right: -6px; }
  .ref-slot-check svg { width: 11px; height: 11px; }
}

.ref-legend { list-style: none; margin: -4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ref-ink-muted); }
.ref-legend li { display: inline-flex; align-items: center; gap: 7px; }
.ref-sw { width: 14px; height: 14px; border-radius: 4px; flex: none; background: var(--ref-well); }
.ref-sw-done { background: var(--ref-cyan-deep); border: 2px solid var(--ref-cyan); }
.ref-sw-wait { border: 2px dashed var(--ref-yellow); }
.ref-sw-empty { border: 2px dashed var(--ref-ink-dim); }

.ref-remain { font-size: 17px; }
.ref-remain b { font: 800 20px/1 Saira, sans-serif; color: var(--ref-yellow); }
.ref-review { font-size: 14px; color: var(--ref-ink-muted); margin-top: -6px !important; }

.ref-ready-note {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px;
  background: rgba(168, 226, 110, 0.12); border: 1px solid var(--ref-green-soft); font-size: 14.5px;
}
.ref-ready-note svg { width: 20px; height: 20px; flex: none; color: var(--ref-green-soft); }

.ref-stats { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ref-stat {
  display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px;
  padding: 12px 14px; border-radius: 10px; background: var(--ref-well); box-shadow: inset 2px 2px 0 var(--ref-inset);
}
.ref-stat dt { font: 700 13px/1.2 'Saira Semi Condensed', sans-serif; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ref-ink-muted); }
.ref-stat dd { margin: 0; font: 800 32px/1 Saira, sans-serif; font-variant-numeric: tabular-nums; }
.ref-stat-ok dd { color: var(--ref-green-soft); }
.ref-stat-wait dd { color: var(--ref-yellow-soft); }
.ref-stat-open dd { color: var(--ref-cyan); }
@media (max-width: 575.98px) {
  .ref-stats { gap: 8px; }
  .ref-stat { padding: 10px; }
  .ref-stat dd { font-size: 26px; }
  .ref-stat dt { font-size: 11.5px; letter-spacing: 0.03em; }
}

.ref-avail {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px 16px;
  padding: 14px 16px; border-radius: 14px; background: var(--ref-well); border: 2px solid transparent;
  box-shadow: inset 2px 2px 0 var(--ref-inset);
}
.ref-avail-icon { width: 60px; height: auto; aspect-ratio: 200 / 210; }
.ref-avail-count { font: 800 22px/1.15 Saira, sans-serif; }
.ref-avail-n { color: var(--ref-yellow); display: inline-block; font-variant-numeric: tabular-nums; }
.ref-avail-help { font-size: 13.5px; color: var(--ref-ink-muted); margin-top: 3px !important; }
.ref-avail.is-ready { border-color: var(--ref-yellow); animation: ref-glow 1.9s ease-in-out infinite; }
.ref-avail.is-ready .ref-avail-icon { animation: ref-wiggle 2.8s ease-in-out infinite; transform-origin: 50% 90%; }
@media (max-width: 575.98px) {
  .ref-avail { grid-template-columns: auto minmax(0, 1fr); }
  .ref-avail-icon { width: 48px; }
  .ref-avail .ref-btn { grid-column: 1 / -1; width: 100%; }
}

/* ---- your referral link ---- */
.ref-field-label { font: 700 14px/1 'Saira Semi Condensed', sans-serif; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ref-cyan); margin-bottom: -8px; }
.ref-field {
  display: block; width: 100%; resize: none; overflow: auto; min-height: 3.6em;
  border: 0; border-radius: 10px; padding: 12px 14px;
  background: var(--ref-well); box-shadow: inset 2px 2px 0 var(--ref-inset);
  color: var(--ref-ink); font: 500 14.5px/1.55 Lexend, sans-serif; word-break: break-all;
}
/* the textarea grows with the link (3 rows where field-sizing is missing) */
@supports (field-sizing: content) { .ref-field { field-sizing: content; overflow: hidden; } }
.ref-field:focus { outline: 2px solid var(--ref-cyan); outline-offset: 2px; }
.ref-btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.referral-page .ref-btn-row .ref-btn { flex: 1 1 160px; font-size: 18px; }
.ref-status { font-size: 13.5px; color: var(--ref-green-soft); margin-top: -6px !important; }
.ref-status:empty { display: none; }
.ref-note { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; color: var(--ref-ink-muted); }
.ref-note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--ref-cyan); }
.ref-divider { border-top: 1px dashed var(--ref-cyan); }
.ref-sub { display: flex; align-items: center; gap: 9px; font: 800 19px/1.2 Saira, sans-serif; color: var(--ref-ink); }
.ref-sub svg { width: 22px; height: 22px; color: var(--ref-yellow); }
.ref-sub-text { margin-top: -8px !important; }

/* ---- how to earn ---- */
.ref-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 576px) { .ref-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 992px) { .ref-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ref-step {
  display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 10px;
  background: var(--ref-panel-row); box-shadow: inset 0 -4px 0 var(--ref-lowlight); font-size: 15px;
}
.ref-step-n {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ref-yellow); border: 3px solid var(--ref-outline); color: var(--ref-chip-ink);
  font: 800 21px/1 Saira, sans-serif; box-shadow: inset 0 3px 0 var(--ref-hl), inset 0 -4px 0 var(--ref-lowlight);
}
.ref-tag {
  margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 15px; color: var(--ref-chip-ink); border: 1px solid var(--ref-outline);
  box-shadow: inset 1px 3px 0 var(--ref-hl), inset 1px -2px 0 var(--ref-inset);
  font: 700 13px/1.2 'Saira Semi Condensed', sans-serif; letter-spacing: 0.05em; text-transform: uppercase;
}
.ref-tag svg { width: 14px; height: 14px; }
.ref-tag-link { background: var(--ref-cyan); }
.ref-tag-wait { background: var(--ref-yellow-soft); }
.ref-tag-ok { background: var(--ref-green-soft); }
.ref-tag-box { background: var(--ref-yellow); }

.ref-rules { border-top: 1px dashed var(--ref-cyan); padding-top: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 992px) { .ref-rules { grid-template-columns: 170px minmax(0, 78ch); gap: 24px; } }
.ref-rules h3 { font: 700 15px/1.6 'Saira Semi Condensed', sans-serif; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ref-cyan); }
.ref-rules p { font-size: 15.5px; line-height: 1.85; }
.ref-odd {
  display: inline-block; white-space: nowrap; padding: 0 9px; border-radius: 5px; margin: 0 1px;
  font: 700 14px/24px 'Saira Semi Condensed', sans-serif; text-transform: uppercase; color: var(--ref-chip-ink);
  font-variant-numeric: tabular-nums; vertical-align: 1px;
}
.ref-odd[data-type="Classic"] { background: #6ECDE2; }
.ref-odd[data-type="Common"] { background: #A8E26E; }
.ref-odd[data-type="Super"] { background: #FDBF47; }
.ref-odd[data-type="Rare"] { background: #EA5C5C; }
.ref-odd[data-type="Limited"], .ref-odd[data-type="Legendary"] { background: #FDE39B; }

/* ---- motion ---- */
@keyframes ref-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes ref-spin { to { transform: rotate(360deg); } }
@keyframes ref-slot-in { 0% { transform: scale(0.55); opacity: 0.2; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes ref-glow {
  0%, 100% { box-shadow: inset 2px 2px 0 var(--ref-inset), 0 0 0 0 rgba(253, 191, 71, 0.55); }
  50% { box-shadow: inset 2px 2px 0 var(--ref-inset), 0 0 22px 3px rgba(253, 191, 71, 0.55); }
}
@keyframes ref-wiggle { 0%, 60%, 100% { transform: rotate(0); } 68% { transform: rotate(-7deg); } 76% { transform: rotate(6deg); } 84% { transform: rotate(-3deg); } 92% { transform: rotate(1deg); } }
@media (prefers-reduced-motion: reduce) {
  .referral-page *, .referral-page *::before, .referral-page *::after { animation: none !important; transition: none !important; }
}
