/* Droidy — Hall of Fame (/fame/). Loaded after site.css. Arcade "hall of champions" look. */
@font-face { font-family: "Orbitron"; src: url("/assets/fonts/orbitron-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url("/assets/fonts/orbitron-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --gold: #ffcf4a; --gold-2: #ff9f1c; --silver: #d9e2f2; --bronze: #e39a62;
  --legend: #ffcf4a; --hero: #39d0ff; --magenta: #ff4fd8; --violet: #8b5cff;
  --hud: "Orbitron", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
}

/* ---------- Hero / arena ---------- */
.fame-hero { position: relative; overflow: hidden; padding: 86px 0 74px; text-align: center; isolation: isolate; }
.fame-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 55% at 50% 0%, rgba(139, 92, 255, .38), transparent 70%),
    radial-gradient(40% 40% at 15% 30%, rgba(255, 79, 216, .16), transparent 70%),
    radial-gradient(40% 40% at 85% 25%, rgba(57, 208, 255, .16), transparent 70%),
    linear-gradient(#07090f, #07090f); }
.fame-bg::after { /* neon grid floor */
  content: ""; position: absolute; left: -50%; right: -50%; bottom: -10%; height: 62%;
  background:
    linear-gradient(rgba(139, 92, 255, .55) 1.5px, transparent 1.5px) 0 0 / 64px 64px,
    linear-gradient(90deg, rgba(139, 92, 255, .55) 1.5px, transparent 1.5px) 0 0 / 64px 64px;
  transform: perspective(420px) rotateX(62deg); transform-origin: 50% 100%;
  mask-image: linear-gradient(to top, #000 10%, transparent 85%); -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 85%);
  animation: grid-run 2.4s linear infinite; }
@keyframes grid-run { to { background-position: 0 64px, 0 0; } }
.fame-sparks { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.fame-sparks i { position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 8px 2px rgba(255, 207, 74, .7); opacity: 0; animation: spark 7s linear infinite; }
@keyframes spark { 0% { transform: translateY(0); opacity: 0 } 10% { opacity: 1 } 100% { transform: translateY(-620px); opacity: 0 } }

.fame-trophy { display: block; width: 128px; height: 128px; margin: 0 auto 14px; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .45)) drop-shadow(0 0 26px rgba(255, 191, 40, .45)); animation: float 4s ease-in-out infinite; }
.fame-trophy img { width: 100%; height: 100%; display: block; }
@keyframes float { 50% { transform: translateY(-8px) } }
.fame-kicker { display: inline-block; font: 700 12px/1 var(--hud); letter-spacing: .28em; color: var(--hero);
  padding: 8px 14px; border: 1px solid rgba(57, 208, 255, .45); border-radius: 4px; background: rgba(57, 208, 255, .08);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.fame-title { margin: 20px 0 14px; font: 900 clamp(40px, 8.4vw, 92px)/1 var(--hud); letter-spacing: .04em;
  background: linear-gradient(180deg, #fff6d0 0%, var(--gold) 45%, var(--gold-2) 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #7a3d00) drop-shadow(0 0 28px rgba(255, 170, 30, .45)); }
.fame-hero .lead { max-width: 640px; margin: 0 auto; color: #c7cede; font-size: 19px; }
.fame-stats { display: flex; justify-content: center; gap: 14px; margin: 34px auto 30px; flex-wrap: wrap; }
.stat { min-width: 150px; padding: 14px 20px 12px; background: rgba(13, 17, 25, .75); border: 1px solid var(--line); border-radius: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.stat b { display: block; font: 900 30px/1 var(--hud); }
.stat span { font: 700 10.5px/1 var(--hud); letter-spacing: .2em; color: var(--muted); }
.stat.l b { color: var(--legend); text-shadow: 0 0 18px rgba(255, 207, 74, .5); }
.stat.h b { color: var(--hero); text-shadow: 0 0 18px rgba(57, 208, 255, .5); }
.stat.c b { color: var(--magenta); text-shadow: 0 0 18px rgba(255, 79, 216, .45); }
.btn-arcade { font: 700 14px/1 var(--hud); letter-spacing: .14em; text-transform: uppercase; padding: 16px 26px; border-radius: 10px;
  background: linear-gradient(180deg, #ffe07a, var(--gold-2)); color: #2b1600; box-shadow: 0 5px 0 #a35200, 0 12px 30px rgba(255, 159, 28, .35); }
.btn-arcade:hover { text-decoration: none; filter: brightness(1.06); }
.btn-arcade:active { transform: translateY(3px); box-shadow: 0 2px 0 #a35200; }

/* ---------- Tiers ---------- */
.tier { padding: 72px 0; position: relative; }
.tier.heroes { background: linear-gradient(180deg, var(--bg-2), var(--bg)); }
.tier-head { display: flex; align-items: center; gap: 18px; margin-bottom: 34px; }
.tier-head .emblem { width: 58px; height: 58px; flex: none; display: grid; place-items: center; border-radius: 14px; transform: rotate(45deg); }
.tier-head .emblem svg { width: 28px; height: 28px; transform: rotate(-45deg); }
.legends .emblem { background: linear-gradient(135deg, #fff1b8, var(--gold-2)); color: #4a2600; box-shadow: 0 0 30px rgba(255, 191, 40, .45); }
.heroes .emblem { background: linear-gradient(135deg, #b9f1ff, #1a8fd6); color: #032236; box-shadow: 0 0 30px rgba(57, 208, 255, .4); }
.tier-head h2 { font: 900 clamp(26px, 4vw, 40px)/1 var(--hud); letter-spacing: .08em; }
.legends .tier-head h2 { color: var(--legend); }
.heroes .tier-head h2 { color: var(--hero); }
.tier-head p { color: var(--muted); margin-top: 6px; font-size: 15px; }
.tier-head .line { flex: 1; height: 2px; margin-left: 10px; background: linear-gradient(90deg, currentColor, transparent); opacity: .35; }
.legends .tier-head .line { color: var(--legend); }
.heroes .tier-head .line { color: var(--hero); }

/* ---------- Avatar (hexagon with initials) ---------- */
.ava { --c1: #8b5cff; --c2: #ff4fd8; width: 64px; height: 64px; flex: none; display: grid; place-items: center;
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
  background: linear-gradient(135deg, var(--c1), var(--c2)); font: 900 22px/1 var(--hud); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.25); }

.ava.photo { background: #1a1f2e; padding: 0; }
.ava.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava.emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-weight: 400; text-shadow: 0 2px 4px rgba(0,0,0,.25); }

/* ---------- Podium (top 3 Legends) ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.12fr 1fr; gap: 18px; align-items: end; margin-bottom: 26px; }
.podium .card { text-align: center; padding: 30px 22px 22px; }
.podium .card .ava { width: 92px; height: 92px; font-size: 32px; margin: 0 auto 14px; }
.podium .p1 { order: 2; padding-top: 44px; min-height: 340px; }
.podium .p2 { order: 1; min-height: 300px; }
.podium .p3 { order: 3; min-height: 280px; }
.podium .medal { position: absolute; z-index: 3; top: -16px; left: 50%; transform: translateX(-50%); font: 900 13px/1 var(--hud); letter-spacing: .14em;
  padding: 9px 14px; border-radius: 8px; color: #241400; white-space: nowrap; }
.p1 .medal { background: linear-gradient(180deg, #fff1b0, var(--gold)); box-shadow: 0 0 24px rgba(255, 207, 74, .6); }
.p2 .medal { background: linear-gradient(180deg, #ffffff, var(--silver)); box-shadow: 0 0 20px rgba(217, 226, 242, .45); }
.p3 .medal { background: linear-gradient(180deg, #ffd2ad, var(--bronze)); box-shadow: 0 0 20px rgba(227, 154, 98, .45); }
.podium .crown { width: 44px; height: 44px; margin: 0 auto 6px; color: var(--gold); filter: drop-shadow(0 0 12px rgba(255, 207, 74, .7)); }
.podium .name { font-size: 22px; }
.podium .msg { margin-top: 10px; }

/* ---------- Cards ---------- */
.card { position: relative; border-radius: 18px; background: linear-gradient(180deg, #161c2b, #0f131d); padding: 18px; transition: transform .25s ease, box-shadow .25s ease;
  transform-style: preserve-3d; will-change: transform; }
.card .name { font-weight: 700; font-size: 17.5px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.card .flag { margin-left: 6px; font-size: .95em; }
.card .msg { color: #b8c0d2; font-size: 14.5px; font-style: italic; overflow-wrap: anywhere; }
.card .msg:not(:empty)::before { content: "“"; } .card .msg:not(:empty)::after { content: "”"; }
.card .meta { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: inherit; font: 700 10px/1 var(--hud); letter-spacing: .14em; color: var(--muted); }
.card .rank { font: 900 12px/1 var(--hud); letter-spacing: .1em; }
.tag { padding: 5px 8px; border-radius: 5px; }

/* Legend: holographic gold border */
.legend-card { padding: 2px; background: conic-gradient(from var(--a, 0deg), var(--gold), var(--magenta), var(--violet), var(--hero), var(--gold));
  animation: holo 6s linear infinite; box-shadow: 0 0 0 1px rgba(255, 207, 74, .15), 0 18px 50px rgba(0, 0, 0, .55), 0 0 40px rgba(255, 191, 40, .12); }
.legend-card > .inner { position: relative; height: 100%; border-radius: 16px; padding: 22px 20px; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255, 207, 74, .14), transparent 60%), linear-gradient(180deg, #1a1a26, #0f1019); }
.legend-card > .inner::after { /* shine sweep */
  content: ""; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, .13) 50%, transparent 58%);
  transform: translateX(-60%); transition: transform .9s ease; pointer-events: none; }
.legend-card:hover > .inner::after { transform: translateX(60%); }
.legend-card .tag { background: rgba(255, 207, 74, .14); color: var(--legend); }
.legend-card .rank { color: var(--legend); }
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes holo { to { --a: 360deg; } }
.podium .legend-card { padding: 2px; }
.podium .legend-card > .inner { padding: 34px 22px 24px; display: flex; flex-direction: column; justify-content: flex-end; min-height: inherit; }

.legend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.legend-grid .inner { display: flex; gap: 14px; align-items: center; }
.legend-grid .info { min-width: 0; flex: 1; }
.legend-grid .msg { margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.legend-grid .meta { margin-top: 8px; }

/* Hero: cyan neon tile */
.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.hero-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid rgba(57, 208, 255, .22);
  background: linear-gradient(180deg, rgba(57, 208, 255, .07), rgba(57, 208, 255, .02)); }
.hero-card:hover { border-color: rgba(57, 208, 255, .6); box-shadow: 0 0 0 1px rgba(57, 208, 255, .25), 0 0 26px rgba(57, 208, 255, .18); }
.hero-card .ava { width: 44px; height: 44px; font-size: 15px; }
.hero-card .info { min-width: 0; }
.hero-card .name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-card .msg { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-card .meta { margin-top: 5px; font-size: 9px; }
.hero-card .rank { color: var(--hero); font-size: 10px; }

/* Empty slots */
.card.ghost { background: repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 10px, transparent 10px 20px); border: 1.5px dashed rgba(255, 255, 255, .16);
  color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; animation: none; box-shadow: none; }
.card.ghost .ava { background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .35); }
.card.ghost b { font: 700 12px/1.3 var(--hud); letter-spacing: .14em; color: #d6dcea; }
.card.ghost a { font-size: 13.5px; }
.podium .card.ghost { min-height: 260px; }
.podium .p1.ghost { min-height: 300px; border-color: rgba(255, 207, 74, .45); }
.hero-card.ghost { flex-direction: row; justify-content: flex-start; min-height: 70px; }

.more { text-align: center; margin-top: 22px; }
.more button { font: 700 12px/1 var(--hud); letter-spacing: .16em; padding: 12px 18px; border-radius: 8px; border: 1px solid rgba(57, 208, 255, .4);
  background: transparent; color: var(--hero); cursor: pointer; }

/* ---------- Join ---------- */
.join { padding: 84px 0 100px; }
.join-card { max-width: 760px; margin: 0 auto; border-radius: 22px; padding: 2px;
  background: linear-gradient(135deg, var(--gold), var(--magenta) 50%, var(--hero)); box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.join-card > div { border-radius: 20px; background: #0d1119; padding: 34px; }
.join h2 { font: 900 clamp(24px, 3.6vw, 34px)/1.1 var(--hud); letter-spacing: .05em; margin-bottom: 8px; }
.join .muted { font-size: 15px; }
.tiers-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 26px; }
.tiers-mini div { border-radius: 12px; padding: 14px 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); font-size: 14px; color: var(--muted); }
.tiers-mini b { display: block; font: 900 13px/1 var(--hud); letter-spacing: .14em; margin-bottom: 7px; }
.tiers-mini .l b { color: var(--legend); } .tiers-mini .h b { color: var(--hero); }
.fame-form { display: grid; gap: 14px; }
.fame-form label { display: grid; gap: 7px; font: 700 11px/1 var(--hud); letter-spacing: .16em; color: #c8cfdd; }
.fame-form input[type=text], .fame-form input[type=password], .fame-form textarea {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif; color: var(--text); letter-spacing: 0;
  background: #070a11; border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px; padding: 12px 14px; width: 100%; }
.fame-form textarea { resize: vertical; min-height: 52px; }
.fame-form input:focus, .fame-form textarea:focus { outline: none; border-color: var(--hero); box-shadow: 0 0 0 3px rgba(57, 208, 255, .22); }
.fame-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fame-form .chk { display: flex; align-items: center; gap: 10px; font: 15px/1.3 -apple-system, sans-serif; letter-spacing: 0; color: var(--muted); }
.fame-form .chk input { width: 18px; height: 18px; accent-color: var(--hero); }
.fame-form .actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.fame-form .link { background: none; border: 0; color: var(--muted); font-size: 14px; cursor: pointer; text-decoration: underline; padding: 0; }
.fame-form .hp { position: absolute; left: -9999px; }
.fame-form .lbl { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.fame-form .count { font: 12px/1 -apple-system, sans-serif; color: var(--muted); letter-spacing: 0; }
.fame-form .row { align-items: end; }
.fame-form input[type=text], .fame-form input[type=password] { height: 48px; }
.fame-note { margin-top: 16px; font-size: 13px; color: var(--muted); }
.fame-msg { display: none; margin-top: 4px; padding: 12px 14px; border-radius: 10px; font-size: 15px; }
.fame-msg.ok { display: block; background: rgba(61, 219, 158, .12); color: #9ff3cf; }
.fame-msg.err { display: block; background: rgba(255, 90, 90, .12); color: #ffb3b3; }
.preview { display: flex; gap: 14px; align-items: center; margin: 4px 0 2px; }
.preview .card { flex: 1; }

/* Level-up toast + confetti */
.levelup { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(.6); opacity: 0; z-index: 100; pointer-events: none;
  font: 900 clamp(28px, 6vw, 56px)/1 var(--hud); letter-spacing: .08em; color: var(--gold); text-shadow: 0 4px 0 #7a3d00, 0 0 40px rgba(255, 191, 40, .7);
  transition: transform .45s cubic-bezier(.2, 1.6, .4, 1), opacity .3s; text-align: center; }
.levelup.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.levelup small { display: block; margin-top: 10px; font-size: .32em; letter-spacing: .3em; color: #fff; text-shadow: none; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 99; }

@media (max-width: 860px) {
  .podium { grid-template-columns: 1fr; }
  .podium .p1, .podium .p2, .podium .p3 { order: 0; min-height: 0; }
  .podium .card.ghost { min-height: 180px; }
  .tiers-mini, .fame-form .row { grid-template-columns: 1fr; }
  .join-card > div { padding: 24px 20px; }
  .fame-stats { gap: 8px; }
  .stat { min-width: 0; flex: 1; padding: 12px 8px 10px; }
  .stat b { font-size: 24px; }
  .stat span { font-size: 9px; letter-spacing: .12em; }
  .hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hero-card { padding: 10px; gap: 9px; }
  .hero-card .ava { width: 36px; height: 36px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .fame-bg::after, .fame-sparks i, .fame-trophy, .legend-card { animation: none; }
  .card { transition: none; }
}
