/* JcoLabs AI Arcade — gamer look for a younger crowd: dark neon (pink / cyan / lime / gold) on deep navy.
   Dark is the default; [data-theme="light"] is the bright variant. Headings Orbitron, text Chakra Petch, logo Press Start 2P. */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #0a0a18; --bg2: #10102a; --card: #15153a; --card2: #1d1d4a; --line: #2f2f6e;
  --text: #eceaff; --muted: #a09ecf; --pink: #ff2e97; --cyan: #00e5ff; --lime: #b6ff3c; --gold: #ffd23f;
  --violet: #7c3aed; --warn: #ff5c7a; --on-accent: #12102b;
  --glow-pink: 0 0 14px rgba(255, 46, 151, .55); --glow-cyan: 0 0 14px rgba(0, 229, 255, .45);
  --radius: 14px; --shadow: 0 6px 24px rgba(0, 0, 0, .45);
  --grid: rgba(0, 229, 255, .05);
}
[data-theme="light"] {
  --bg: #f1f0ff; --bg2: #e6e4ff; --card: #ffffff; --card2: #f6f5ff; --line: #cfcbf5;
  --text: #1b1745; --muted: #5c58a0; --pink: #d6006f; --cyan: #007c96; --lime: #3d8f00; --gold: #b07a00;
  --violet: #5b21b6; --warn: #c8153b; --on-accent: #ffffff;
  --glow-pink: 0 2px 10px rgba(214, 0, 111, .3); --glow-cyan: 0 2px 10px rgba(0, 124, 150, .25);
  --shadow: 0 4px 18px rgba(60, 40, 160, .12); --grid: rgba(91, 33, 182, .05);
}

body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: var(--text);
  font: 400 16px/1.55 'Chakra Petch', system-ui, sans-serif;
  background: radial-gradient(1000px 500px at 12% -10%, rgba(124, 58, 237, .28), transparent 60%),
              radial-gradient(900px 500px at 100% 0%, rgba(255, 46, 151, .16), transparent 55%), var(--bg); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px; }
html.ar-backdrop body::before { display: none; }  /* the main-page backdrop canvas replaces the static grid */
body > * { position: relative; z-index: 1; }
h1, h2, h3 { font-family: 'Orbitron', 'Chakra Petch', sans-serif; font-weight: 700; color: var(--text); margin: 0 0 .45em;
  line-height: 1.15; letter-spacing: .02em; }
h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); } h2 { font-size: 1.15rem; }
a { color: var(--cyan); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
::selection { background: var(--pink); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* Header */
.ar-header { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 14px 28px; flex-wrap: wrap;
  background: rgba(10, 10, 24, .78); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0;
  z-index: 20; }
[data-theme="light"] .ar-header { background: rgba(241, 240, 255, .85); }
.ar-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--pink), var(--violet), var(--cyan)); opacity: .9; }
.ar-brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1.1; }
.ar-brand small { font: 500 .68rem 'Chakra Petch', sans-serif; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.ar-brand span { font: 400 1.15rem 'Press Start 2P', monospace; letter-spacing: .02em;
  background: linear-gradient(90deg, var(--pink), var(--gold) 55%, var(--cyan)); -webkit-background-clip: text; background-clip: text;
  color: transparent; filter: drop-shadow(0 0 8px rgba(255, 46, 151, .35)); }
.ar-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ar-nav a { text-decoration: none; padding: 7px 15px; border-radius: 999px; font-weight: 600; color: var(--text); letter-spacing: .03em;
  text-transform: uppercase; font-size: .85rem; }
.ar-nav a:hover { background: var(--card2); color: var(--cyan); }
.ar-nav a.on { background: linear-gradient(135deg, var(--pink), var(--violet)); color: #fff; box-shadow: var(--glow-pink); }
.ar-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.ar-nav a.ar-cta-btn, .ar-cta-btn { text-decoration: none; padding: 9px 20px; border-radius: 999px; font: 700 .9rem 'Orbitron', sans-serif;
  letter-spacing: .05em; text-transform: uppercase; color: #fff; border: 2px solid transparent; white-space: nowrap;
  animation: ar-cta-glow 2.4s ease-in-out infinite; transition: transform .15s, filter .15s; }
.ar-cta-btn:hover { transform: translateY(-2px) scale(1.04); filter: brightness(1.15); color: #fff; }
.ar-cta-play { background: linear-gradient(135deg, var(--pink), var(--violet)); --cta-glow: 255, 46, 151; }
.ar-cta-build { background: linear-gradient(135deg, var(--lime), var(--cyan)); color: #0a1a12; --cta-glow: 0, 229, 255; }
.ar-cta-build:hover { color: #0a1a12; }
.ar-cta-btn.on { border-color: var(--gold); }
@keyframes ar-cta-glow { 0%, 100% { box-shadow: 0 0 8px rgba(var(--cta-glow), .45); } 50% { box-shadow: 0 0 22px rgba(var(--cta-glow), .9); } }
.ar-nick { color: var(--lime); font-weight: 600; padding: 0 6px; font-size: .9rem; }
.ar-bal { display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding-right: 4px; }
.ar-nav .ar-bal-link { padding: 5px 4px 5px 14px; background: none; box-shadow: none; font-size: .9rem; }
.ar-nav .ar-bal-link:hover { background: none; }
.ar-bal-label { color: var(--muted); font-weight: 500; }
.ar-bal-amt, .ar-bal-mask { color: var(--gold); font-variant-numeric: tabular-nums; }
.ar-bal-low .ar-bal-amt { color: var(--pink); }
.ar-bal-mask { display: none; }
.ar-bal-toggle { background: none; border: 0; color: var(--cyan); cursor: pointer; font: 600 .78rem 'Chakra Petch', sans-serif; padding: 5px 10px; }
.ar-bal-toggle:hover { color: var(--text); }
.ar-bal-show { display: none; }
[data-hide-balance="1"] .ar-bal-amt { display: none; }
[data-hide-balance="1"] .ar-bal-mask { display: inline; }
[data-hide-balance="1"] .ar-bal-hide { display: none; }
[data-hide-balance="1"] .ar-bal-show { display: inline; }
.ar-iconbtn { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 6px 13px;
  cursor: pointer; font: 600 .8rem 'Chakra Petch', sans-serif; }
.ar-iconbtn:hover { border-color: var(--cyan); color: var(--cyan); }
.ar-link { background: none; border: none; color: var(--pink); cursor: pointer; font: 600 .9rem 'Chakra Petch', sans-serif; padding: 0 6px; }
.ar-footer { display: flex; gap: 8px 20px; justify-content: center; flex-wrap: wrap; padding: 22px 16px; font-size: .85rem;
  color: var(--muted); border-top: 1px solid var(--line); background: var(--bg2); }
.ar-footer a { color: var(--muted); }
.ar-rev { font-size: .65rem; opacity: .3; font-family: ui-monospace, monospace; user-select: all; }

/* Buttons and bits */
.ar-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--pink)); padding: 10px 24px; border-radius: 999px; min-height: 44px;
  font: 700 .95rem 'Chakra Petch', sans-serif; letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
  text-decoration: none; box-shadow: var(--glow-pink); transition: transform .12s, filter .15s; }
.ar-btn:hover { transform: translateY(-1px); filter: brightness(1.12); }
.ar-btn:active { transform: translateY(1px); }
.ar-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.ar-btn-ghost { background: transparent; color: var(--cyan); border-color: var(--cyan); box-shadow: none; }
.ar-btn-ghost:hover { background: rgba(0, 229, 255, .1); box-shadow: var(--glow-cyan); }
.ar-btn-amber { background: linear-gradient(135deg, var(--gold), #ff8a1f); color: var(--on-accent); box-shadow: 0 0 16px rgba(255, 190, 40, .45); }
[data-theme="light"] .ar-btn-amber { color: #2b1b00; }
.ar-btn-block { width: 100%; }
.ar-back { align-self: flex-start; margin-bottom: 14px; min-height: 56px; padding: 12px 32px; font-size: 1.15rem; background: var(--lime);
  color: #12102b; box-shadow: 0 0 18px rgba(182, 255, 60, .5); }
@media (max-width: 600px) { .ar-back { width: 100%; align-self: stretch; } }
.ar-btn-small { padding: 6px 14px; min-height: 36px; font-size: .8rem; }
.ar-muted { color: var(--muted); }
.ar-small { font-size: .85rem; }
.ar-error { color: var(--warn); font-weight: 500; }
.ar-badge { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 6px; background: var(--card2); color: var(--muted); white-space: nowrap; border: 1px solid var(--line); }
.ar-badge-on { color: var(--lime); border-color: rgba(182, 255, 60, .4); background: rgba(182, 255, 60, .08); }
.ar-inline { display: inline; }

/* Hero banner: the AI game builder, first thing on the home page. */
.ar-hero { display: flex; align-items: center; justify-content: space-between; gap: 22px 32px; flex-wrap: wrap; position: relative;
  overflow: hidden; border-radius: 22px; padding: 44px 44px; margin-bottom: 28px; color: #fff;
  background: linear-gradient(120deg, #2a0a6b 0%, #6a11cb 42%, #ff2e97 100%); box-shadow: 0 10px 40px rgba(124, 58, 237, .45);
  border: 1px solid rgba(255, 255, 255, .18); }
.ar-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .13) 0 2px, transparent 2px 5px); }
.ar-hero::after { content: ""; position: absolute; right: -50px; top: -70px; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, .55), transparent 68%); }
.ar-hero > * { position: relative; z-index: 1; }
.ar-hero-kicker { display: inline-block; font: 400 .62rem 'Press Start 2P', monospace; color: #ffd23f; margin-bottom: 14px;
  letter-spacing: .08em; }
.ar-hero h1 { color: #fff; font-weight: 900; font-size: clamp(1.9rem, 5vw, 3.1rem); margin-bottom: .25em;
  text-shadow: 0 0 22px rgba(255, 255, 255, .35), 3px 3px 0 rgba(0, 0, 0, .35); }
.ar-hero p { margin: 0; max-width: 560px; font-size: 1.1rem; color: rgba(255, 255, 255, .92); }
.ar-hero .ar-btn { background: linear-gradient(135deg, var(--gold), #ff8a1f); color: #2b1b00; font-size: 1.05rem; padding: 15px 32px;
  box-shadow: 0 0 26px rgba(255, 200, 60, .6); animation: ar-pulse 2.4s ease-in-out infinite; }
@keyframes ar-pulse { 0%, 100% { box-shadow: 0 0 18px rgba(255, 200, 60, .45); } 50% { box-shadow: 0 0 34px rgba(255, 200, 60, .85); } }
@media (prefers-reduced-motion: reduce) { .ar-hero .ar-btn, .ar-cta-btn { animation: none; } * { transition: none !important; } }

/* Soft navigation (nav.js) */
html.ar-navigating body { cursor: progress; }
html.ar-swapping body { visibility: hidden; }
.ar-main:focus { outline: none; }

/* Jukebox (in the header, every page except the game screens) */
.ar-jb { position: relative; display: flex; align-items: center; gap: 6px; }
.ar-jb.playing .ar-jb-play { box-shadow: var(--glow-pink); }
.ar-jb-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card2); color: var(--text);
  font-size: .95rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none; }
.ar-jb-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.ar-jb-btn.on { border-color: var(--lime); background: rgba(182, 255, 60, .1); }
.ar-jb-play { background: linear-gradient(135deg, var(--pink), var(--violet)); border-color: transparent; color: #fff; }
.ar-jb-play:hover { color: #fff; filter: brightness(1.12); }
.ar-jb-name { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 999px; min-width: 0;
  border: 1px solid var(--line); background: var(--card2); color: var(--text); cursor: pointer; }
.ar-jb-name:hover, .ar-jb-name[aria-expanded="true"] { border-color: var(--cyan); }
.ar-jb.playing .ar-jb-name { border-color: var(--pink); }
.ar-jb-track { font: 700 .78rem 'Orbitron', sans-serif; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 150px; }
.ar-jb.waiting .ar-jb-track { white-space: normal; color: var(--gold); font-size: .68rem; line-height: 1.15; max-width: 130px; }
.ar-jb-eq { display: flex; align-items: flex-end; gap: 2px; height: 16px; flex: none; }
.ar-jb-eq i { display: block; width: 3px; height: 25%; border-radius: 1px; background: var(--cyan); }
.ar-jb.playing .ar-jb-eq i { animation: ar-eq .7s ease-in-out infinite alternate; }
.ar-jb.playing .ar-jb-eq i:nth-child(2) { animation-duration: .5s; background: var(--pink); }
.ar-jb.playing .ar-jb-eq i:nth-child(3) { animation-duration: .85s; background: var(--lime); }
.ar-jb.playing .ar-jb-eq i:nth-child(4) { animation-duration: .6s; }
@keyframes ar-eq { from { height: 20%; } to { height: 100%; } }
.ar-jb-panel { position: absolute; top: calc(100% + 10px); left: 0; z-index: 30; display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  width: 300px; max-width: calc(100vw - 32px); padding: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.ar-jb-panel[hidden] { display: none; }
.ar-jb-vol { flex: 1 1 100px; min-width: 80px; accent-color: var(--pink); }
@media (max-width: 900px) { .ar-jb { margin-left: auto; } .ar-jb-panel { left: auto; right: 0; } }
@media (prefers-reduced-motion: reduce) { .ar-jb.playing .ar-jb-eq i { animation: none; height: 60%; } }

.ar-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.ar-chip { text-decoration: none; padding: 6px 15px; border-radius: 999px; border: 1px solid var(--line); font-size: .85rem; font-weight: 600;
  color: var(--text); background: var(--card); text-transform: uppercase; letter-spacing: .04em; }
.ar-chip:hover { border-color: var(--cyan); color: var(--cyan); }
.ar-chip.on { background: linear-gradient(135deg, var(--cyan), var(--violet)); color: #fff; border-color: transparent; box-shadow: var(--glow-cyan); }

/* Game cards: a screenshot, or a generated cover when a game has none */
.ar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.ar-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--text); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s, border-color .15s, box-shadow .15s; }
.ar-card:hover { transform: translateY(-4px); border-color: var(--pink); box-shadow: var(--shadow), var(--glow-pink); }
.ar-card-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.ar-card h3 { margin: 0; font-size: 1.1rem; }
.ar-card p { margin: 0; color: var(--muted); font-size: .95rem; flex: 1; }
.ar-cover { display: grid; place-items: center; height: 118px; font-size: 3.2rem; position: relative; overflow: hidden; }
.ar-cover::before { content: ""; position: absolute; inset: 0; opacity: .35;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .18) 0 2px, transparent 2px 14px); }
.ar-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ar-cover span { position: relative; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .5)); }
.ar-cover-lg { height: 150px; border-radius: var(--radius); margin-bottom: 16px; font-size: 4.4rem; }
.cv0 { background: linear-gradient(135deg, #7c3aed, #ff2e97); } .cv1 { background: linear-gradient(135deg, #0891b2, #7c3aed); }
.cv2 { background: linear-gradient(135deg, #16a34a, #0891b2); } .cv3 { background: linear-gradient(135deg, #f97316, #ff2e97); }
.cv4 { background: linear-gradient(135deg, #2563eb, #00e5ff); } .cv5 { background: linear-gradient(135deg, #db2777, #7c3aed); }
.cv6 { background: linear-gradient(135deg, #ca8a04, #ea580c); } .cv7 { background: linear-gradient(135deg, #4f46e5, #16a34a); }
/* The poster (SVG) on a game's page, above the screenshots */
.ar-poster { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--radius); margin-bottom: 16px;
  border: 1px solid var(--line); box-shadow: var(--shadow); }
/* Screenshots on a game's page: a row you swipe on a phone */
.ar-shots { display: flex; gap: 12px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 8px; scroll-snap-type: x proximity; }
.ar-shots img { flex: 0 0 auto; height: 240px; width: auto; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card2); scroll-snap-align: start; box-shadow: var(--shadow); }
.ar-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ar-empty { text-align: center; padding: 48px 16px; color: var(--muted); }

.ar-game { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
.ar-game-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.ar-game-head h1 { margin: 0; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.ar-game-head form { margin: 0; }
.ar-game-head .ar-panel { flex: 1 1 100%; margin: 0; }
.ar-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.ar-price { margin: 14px 0; padding: 12px 14px; background: var(--card2); border: 1px dashed var(--gold); border-radius: 10px;
  font-size: .95rem; }
.ar-price strong { color: var(--gold); }
.ar-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.ar-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.ar-table td, .ar-table th { padding: 7px 4px; text-align: left; border-bottom: 1px solid var(--line); }
.ar-table th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: .75rem; letter-spacing: .08em; }
.ar-table td:last-child, .ar-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.ar-table tr.me td { color: var(--lime); background: rgba(182, 255, 60, .07); }
.rk1 { color: var(--gold) !important; text-shadow: 0 0 10px rgba(255, 210, 63, .6); }
.rk2 { color: #d4d9ea !important; } .rk3 { color: #e8955a !important; }
.rk1::before { content: "\1F451  "; } 

.ar-auth { max-width: 440px; margin: 40px auto; }
.ar-form label { display: block; margin: 12px 0; font-weight: 500; }
.ar-form input[type=text], .ar-form input[type=email], .ar-form input[type=password], .ar-builder textarea, .ar-send input { display: block; width: 100%; margin-top: 4px; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); color: var(--text); font: inherit; }
.ar-form input:focus, .ar-builder textarea:focus, .ar-send input:focus { border-color: var(--cyan); box-shadow: var(--glow-cyan); outline: none; }

/* The terms and privacy pages (legal.py) */
.ar-auth.ar-legal { max-width: 760px; }
.ar-legal h2 { margin: 26px 0 8px; font-size: 1.1rem; color: var(--cyan); }
.ar-legal ul { padding-left: 20px; } .ar-legal li { margin: 8px 0; }
.ar-legal-table table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.ar-legal-table th, .ar-legal-table td { padding: 9px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.ar-legal-table th { color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.ar-legal-table td:first-child { font-weight: 700; color: var(--lime); }
@media (max-width: 640px) {
  .ar-legal-table thead { display: none; }
  .ar-legal-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .ar-legal-table td { display: block; padding: 3px 0; border: 0; }
}

/* The invitation landing page */
.ar-landing-kicker { margin: 0 0 6px; font: 700 .8rem 'Orbitron', sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--lime); }
.ar-landing-title { font-size: clamp(1.35rem, 5.4vw, 1.9rem); overflow-wrap: anywhere; }
.ar-landing-name { color: var(--pink); text-shadow: var(--glow-pink); }
.ar-landing-actions { display: grid; gap: 10px; margin: 20px 0 6px; }
.ar-landing-stop { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; }
.ar-landing-stop p { margin: 0 0 8px; }

/* The play page */
.ar-play { display: flex; flex-direction: column; gap: 12px; }
.ar-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.ar-bar h1 { margin: 0; font-size: 1.5rem; }
#ar-clock { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#ar-timer { font: 700 1.3rem 'Orbitron', sans-serif; font-variant-numeric: tabular-nums; color: var(--lime);
  text-shadow: 0 0 12px rgba(182, 255, 60, .55); background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 2px 12px; }
.ar-stage { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; border: 2px solid var(--violet);
  box-shadow: 0 0 0 1px var(--line), 0 0 30px rgba(124, 58, 237, .45); }
#ar-frame { display: block; width: 100%; height: min(78vh, 720px); min-height: 360px; border: 0; background: #fff; }
/* Full screen: the bar shrinks to a slim strip, the game takes everything else (dvh: the phone's address bar moves) */
html.ar-fs, html.ar-fs body { overflow: hidden; }
html.ar-fs .ar-header, html.ar-fs .ar-footer { display: none; }
.ar-play:fullscreen { background: var(--bg); }
.ar-play.fs { position: fixed; inset: 0; z-index: 100; gap: 0; background: var(--bg); height: 100vh; height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.ar-play.fs .ar-bar { flex: none; flex-wrap: nowrap; padding: 4px 8px; gap: 8px; }
.ar-play.fs .ar-bar h1 { font-size: .95rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ar-play.fs #ar-clock { flex-wrap: nowrap; gap: 6px; }
.ar-play.fs #ar-clock .ar-btn { padding: 4px 10px; font-size: .78rem; min-height: 32px; white-space: nowrap; }
.ar-play.fs #ar-timer { font-size: 1rem; padding: 1px 8px; }
.ar-play.fs #ar-status { display: none; }
.ar-play.fs .ar-stage { flex: 1; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
.ar-play.fs #ar-frame { height: 100%; min-height: 0; }
.ar-play.fs .ar-result { display: none; }
/* Phone: six controls do not fit one row, so they wrap, with the timer, Pause and Stop first so they never fall off screen */
@media (max-width: 640px) {
  .ar-play.fs .ar-bar { min-width: 0; }
  .ar-play.fs .ar-bar h1 { display: none; }
  .ar-play.fs #ar-clock { width: 100%; flex-wrap: wrap; justify-content: flex-start; gap: 4px 6px; }
  .ar-play.fs #ar-clock .ar-btn { padding: 4px 8px; font-size: .74rem; min-height: 30px; }
  .ar-play.fs #ar-timer { order: 1; }
  .ar-play.fs #ar-pause { order: 2; }
  .ar-play.fs #ar-stop { order: 3; }
  .ar-play.fs #ar-music, .ar-play.fs #ar-sfx, .ar-play.fs #ar-controls, .ar-play.fs #ar-fs { order: 4; }
}
.ar-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(6, 6, 20, .86); z-index: 5; }
.ar-overlay-box { background: var(--card); border: 1px solid var(--pink); border-radius: var(--radius); padding: 26px; max-width: 420px;
  text-align: center; box-shadow: var(--glow-pink); }
.ar-overlay-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.ar-result { text-align: center; padding: 28px 16px; }
.ar-result strong { font: 900 3rem 'Orbitron', sans-serif; color: var(--gold); display: block; text-shadow: 0 0 22px rgba(255, 210, 63, .6); }

/* Layout with the left menu */
.ar-layout { flex: 1; display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; width: 100%; max-width: 1440px;
  margin: 0 auto; padding: 24px 16px 40px; align-items: start; }
.ar-main { flex: 1; min-width: 0; }
.ar-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 100px); overflow-y: auto; }
.ar-side-sec { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.ar-side-sec h2 { font-size: .95rem; text-transform: uppercase; letter-spacing: .1em; color: var(--cyan); margin-bottom: .5em; }
.ar-side-sec h3 { font: 600 .95rem 'Chakra Petch', sans-serif; margin: 10px 0 4px; color: var(--text); letter-spacing: 0; }
.ar-side-sec h3 a { text-decoration: none; color: var(--text); }
.ar-side-sec h3 a:hover { color: var(--pink); }
.ar-side-rank { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.ar-side-rank li { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.ar-side-rank li.me { color: var(--lime); font-weight: 600; }
.ar-side-pos { flex: none; width: 1.5em; color: var(--muted); font-weight: 700; }
.ar-side-pos.rk1::before { content: none; }
.ar-side-nick { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-side-score { font-variant-numeric: tabular-nums; font-weight: 700; }
.ar-feed, .ar-rooms, .ar-msgs, .ar-list { list-style: none; margin: 0; padding: 0; }
.ar-feed li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.ar-feed li:last-child { border-bottom: 0; }
.ar-feed-head { font-size: .8rem; color: var(--muted); }
.ar-feed-head strong { color: var(--pink); }
.ar-feed-head a { color: var(--cyan); text-decoration: none; }
.ar-feed-body { overflow-wrap: anywhere; }
.ar-rooms li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: .95rem; }
.ar-rooms a { text-decoration: none; color: var(--text); font-weight: 500; }
.ar-rooms a:hover { color: var(--cyan); }
.ar-menubtn { display: none; }

.ar-room { max-width: 760px; }
.ar-msgs { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px; height: min(60vh, 520px); overflow-y: auto; }
.ar-msgs li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.ar-msgs li:last-child { border-bottom: 0; }
.ar-msgs li.mine .ar-msg-head strong { color: var(--lime); }
.ar-msg-head { font-size: .82rem; display: flex; gap: 6px; align-items: baseline; color: var(--muted); }
.ar-msg-head strong { color: var(--pink); }
.ar-msg-body { overflow-wrap: anywhere; }
.ar-report { margin-left: auto; font-size: .78rem; color: var(--muted); }
.ar-send { display: flex; gap: 8px; margin-top: 10px; }
.ar-send input { flex: 1; min-width: 0; margin: 0; border-radius: 999px; }

/* Game builder */
.ar-builder { max-width: 1000px; }
.ar-builder textarea { margin: 8px 0; resize: vertical; }
.ar-options { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 16px; margin: 0 0 16px; }
.ar-options legend { font-family: 'Orbitron', sans-serif; font-weight: 700; color: var(--cyan); padding: 0 8px; }
.ar-options-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 16px; margin-top: 8px; }
.ar-option { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
.ar-option select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); color: var(--text); font: inherit; min-height: 44px; }
.ar-option select:focus { border-color: var(--cyan); box-shadow: var(--glow-cyan); outline: none; }
.ar-option-wide { grid-column: 1 / -1; }
.ar-extras { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.ar-panel { margin-bottom: 16px; }
.ar-rules ul, .ar-limits ul { margin: 0; padding-left: 20px; }
.ar-limits li { margin-bottom: 6px; }
.ar-count-low { color: var(--warn); font-weight: 700; }
.ar-count-near { color: var(--gold); font-weight: 700; }
.ar-meter { display: block; width: 100%; max-width: 360px; height: 12px; margin-top: 6px; background: var(--card2);
  border: 1px solid var(--line); border-radius: 8px; }
.ar-meter::-webkit-meter-bar { background: var(--card2); border-radius: 8px; height: 12px; }
.ar-meter::-webkit-meter-optimum-value { background: var(--lime); border-radius: 8px; }
.ar-meter::-webkit-meter-suboptimum-value { background: var(--gold); border-radius: 8px; }
.ar-meter::-webkit-meter-even-less-good-value { background: var(--pink); border-radius: 8px; }
.ar-meter:-moz-meter-optimum::-moz-meter-bar { background: var(--lime); }
.ar-meter:-moz-meter-sub-optimum::-moz-meter-bar { background: var(--gold); }
.ar-meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--pink); }
.ar-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ar-check { display: flex; gap: 8px; align-items: center; margin: 8px 0; font-weight: 400; }
.ar-form .ar-check input { width: auto; margin: 0; accent-color: var(--pink); }
.ar-tagpick { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 12px 0; }
.ar-tagpick .ar-check { display: inline-flex; margin: 4px 14px 4px 0; }
.ar-testlog { margin-top: 12px; }
#ar-test-frame { display: block; width: 100%; height: min(70vh, 640px); min-height: 340px; border: 0; background: #fff; }
.ar-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ar-pair > div { min-width: 0; }
.ar-pair-cap { margin: 0 0 4px; font: 700 .85rem 'Orbitron', sans-serif; color: var(--cyan); }
.ar-pair iframe, .ar-pair #ar-test-frame { display: block; width: 100%; height: min(60vh, 560px); min-height: 300px; border: 0; background: #fff; }
.ar-game > aside, .ar-game > div { min-width: 0; }

@media (max-width: 900px) {
  .ar-header { padding: 10px 16px; }
  .ar-cta { order: 3; width: 100%; }
  .ar-cta-btn { flex: 1; text-align: center; padding: 10px 12px; font-size: .8rem; }
  .ar-hero { padding: 28px 22px; }
  .ar-game { grid-template-columns: 1fr; }
  .ar-pair { grid-template-columns: 1fr; }
  #ar-frame { height: 70vh; }
  .ar-layout { grid-template-columns: 1fr; gap: 12px; padding-top: 12px; }
  .ar-side { display: none; position: static; max-height: none; }
  .ar-side.open { display: flex; }
  .ar-menubtn { display: inline-block; }
}

/* Combined leaderboard and player page */
.ar-table-wide td:not(:first-child), .ar-table-wide th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.ar-table-wide td.ar-l, .ar-table-wide th.ar-l { text-align: left; }
.ar-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 20px; }
.ar-stat { flex: 1 1 110px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-align: center; }
.ar-stat strong { display: block; font-family: 'Orbitron', sans-serif; font-size: 1.5rem; color: var(--gold); }
.ar-stat span { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }

/* Staff: upload a screenshot */
.ar-staffgame { margin: 16px 0; }
.ar-staffslots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.ar-staffslot { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.ar-staffslot.flash { border-color: var(--lime); box-shadow: 0 0 12px rgba(182, 255, 60, .35); }
.ar-staffslot img { width: 100%; height: auto; max-height: 260px; object-fit: contain; background: var(--card2); border-radius: 8px; }
.ar-ok { color: var(--lime); font-weight: 600; }

/* Search bar: neon-cyan on focus; the suggestions drop down over the cards */
.ar-search { position: relative; display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 6px 6px 6px 16px;
  background: var(--card); border: 2px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.ar-search:focus-within { border-color: var(--cyan); box-shadow: var(--shadow), var(--glow-cyan); }
.ar-search-icon { font-size: 1.1rem; opacity: .8; }
.ar-search input[type="search"] { flex: 1; min-width: 0; padding: 10px 4px; border: 0; outline: 0; background: transparent; color: var(--text);
  font: 500 1.05rem 'Chakra Petch', system-ui, sans-serif; -webkit-appearance: none; appearance: none; }
.ar-search input[type="search"]::-webkit-search-cancel-button { display: none; }
.ar-search input::placeholder { color: var(--muted); }
.ar-search-key { padding: 1px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font: 600 .8rem 'Orbitron', sans-serif; }
.ar-search:focus-within .ar-search-key { display: none; }
.ar-search-clear { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--muted); text-decoration: none; font-size: 1.3rem; line-height: 1; }
.ar-search-clear:hover { color: var(--pink); }
.ar-search-go { padding: 10px 20px; border: 0; border-radius: 999px; cursor: pointer; background: linear-gradient(135deg, var(--pink), var(--violet));
  color: #fff; font: 700 .85rem 'Orbitron', sans-serif; letter-spacing: .05em; text-transform: uppercase; box-shadow: var(--glow-pink); }
.ar-search-go:hover { filter: brightness(1.12); }
.ar-sug { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; max-height: 60vh; overflow-y: auto;
  background: var(--card2); border: 1px solid var(--cyan); border-radius: var(--radius); box-shadow: var(--shadow), var(--glow-cyan); }
.ar-sug-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.ar-sug-item.on { background: rgba(0, 229, 255, .14); }
.ar-sug-type { flex: none; min-width: 84px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
  font: 700 .68rem 'Orbitron', sans-serif; letter-spacing: .06em; text-align: center; text-transform: uppercase; }
.ar-sug-title .ar-sug-type { color: var(--pink); border-color: var(--pink); }
.ar-sug-maker .ar-sug-type { color: var(--lime); border-color: var(--lime); }
.ar-sug-subject .ar-sug-type { color: var(--cyan); border-color: var(--cyan); }
.ar-sug-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ar-sug-label mark { background: none; color: var(--gold); }
@media (max-width: 600px) { .ar-search-key { display: none; } .ar-search-go { padding: 10px 14px; } .ar-sug-type { min-width: 0; } }

.ar-codes { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.ar-key, .ar-codes code { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; color: var(--cyan); word-break: break-all; }
.ar-qr { display: block; max-width: 100%; height: auto; background: #fff; padding: 8px; border-radius: 8px; }

/* build progress */
.ar-steps { list-style: none; margin: 10px 0; padding: 0; }
.ar-steps li { padding: 4px 0 4px 26px; position: relative; color: var(--muted); }
.ar-steps li::before { content: '\25CB'; position: absolute; left: 4px; }
.ar-steps li.ar-step-done { color: var(--text); }
.ar-steps li.ar-step-done::before { content: '\2713'; color: var(--lime); }
.ar-steps li.ar-step-now { color: var(--cyan); font-weight: 700; }
.ar-steps li.ar-step-now::before { content: '\25B6'; color: var(--cyan); }
.ar-pbar { height: 12px; max-width: 420px; border-radius: 8px; background: var(--card2); overflow: hidden; }
.ar-pbar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--cyan)); transition: width .8s ease; }
.ar-pbar-wait > div { width: 40% !important; animation: ar-wait 1.4s ease-in-out infinite alternate; }
@keyframes ar-wait { from { margin-left: 0; } to { margin-left: 60%; } }
@media (prefers-reduced-motion: reduce) { .ar-pbar-wait > div { animation: none; } .ar-pbar > div { transition: none; } }

/* Friends: the badge in the menu, the invite banner under the header and the Friends page */
.ar-fr-badge { display: inline-block; min-width: 1.5em; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--pink);
  color: #fff; font: 700 .72rem/1.6 'Chakra Petch', sans-serif; text-align: center; box-shadow: var(--glow-pink); }
.ar-invites { display: flex; flex-direction: column; gap: 8px; padding: 10px 28px 0; }
.ar-invite { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: var(--card);
  border: 1px solid var(--gold); border-radius: var(--radius); box-shadow: var(--shadow); }
.ar-invite-text { flex: 1 1 220px; font-weight: 600; }
html.ar-fs .ar-invites { display: none; }
.ar-friends h2 { margin-top: 1.4em; }
.ar-friends ul { list-style: none; margin: 0; padding: 0; }
.ar-friends li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ar-friends .ar-fr-nick { flex: 1 1 140px; font-weight: 600; color: var(--lime); }
#ar-fr-msg { margin: 6px 0 0; color: var(--lime); font-weight: 500; }
#ar-fr-msg.ar-error { color: var(--warn); }
.ar-fr-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.ar-fr-dot.on { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.ar-fr-game { font-size: .85rem; color: var(--cyan); }
.ar-fr-presence { margin: 14px 0; }
.ar-fr-presence h2 { margin: 0 0 6px; font-size: 1.05rem; }
.ar-fr-online h2 { margin: 0 0 8px; font-size: 1.05rem; color: var(--lime); }
.ar-fr-online ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ar-fr-online li { display: flex; align-items: center; gap: 8px; }
.ar-fr-online .ar-fr-dot { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.ar-fr-online .ar-fr-nick { font-weight: 600; color: var(--lime); }
.ar-fr-mail { margin-top: 18px; }
.ar-fr-mail h2 { margin: 0 0 6px; font-size: 1.05rem; }
.ar-fr-mail p { margin: 0 0 4px; }
#ar-fr-mail-msg { margin: 8px 0 0; color: var(--lime); font-weight: 500; }
#ar-fr-mail-msg.ar-error { color: var(--warn); }
@media (max-width: 600px) { .ar-invites { padding: 10px 16px 0; } .ar-friends li .ar-btn { flex: 1 1 auto; } }

/* Messages: the inbox rows, the unread pill, and the thread with its bubbles */
.ar-inbox, .ar-thread { max-width: 760px; }
.ar-inbox-list, .ar-bubbles { list-style: none; margin: 0; padding: 0; }
.ar-inbox-list li { margin-bottom: 8px; }
.ar-inbox-row { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text); text-decoration: none; }
.ar-inbox-row:hover, .ar-inbox-row:focus-visible { border-color: var(--cyan); box-shadow: var(--glow-cyan); outline: none; }
.ar-inbox-unread { border-color: var(--pink); }
.ar-inbox-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ar-inbox-nick { color: var(--lime); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-inbox-head .ar-ago { margin-left: auto; font-size: .78rem; white-space: nowrap; }
.ar-inbox-last { overflow-wrap: anywhere; font-size: .92rem; color: var(--muted); }
.ar-inbox-unread .ar-inbox-last { color: var(--text); }
.ar-inbox-you { color: var(--muted); }
.ar-unread { flex: none; min-width: 1.6em; padding: 0 7px; border-radius: 999px; background: var(--pink); color: #fff;
  font: 700 .74rem/1.7 'Chakra Petch', sans-serif; text-align: center; box-shadow: var(--glow-pink); }
.ar-thread-back { margin: 0 0 4px; }
.ar-thread-back a { color: var(--cyan); text-decoration: none; font-weight: 600; }
.ar-thread h1 { margin-top: 0; color: var(--lime); overflow-wrap: anywhere; }
.ar-bubbles { display: flex; flex-direction: column; gap: 8px; }
.ar-bubble { display: flex; flex-direction: column; gap: 3px; max-width: 82%; padding: 8px 12px; border-radius: 16px; overflow-wrap: anywhere; }
.ar-bubble.theirs { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ar-bubble.mine { align-self: flex-end; background: var(--lime); color: var(--on-accent); border-bottom-right-radius: 4px; }
.ar-bubble-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: .74rem; }
.ar-bubble.mine .ar-bubble-meta { justify-content: flex-end; }
.ar-bubble.mine .ar-ago { color: inherit; opacity: .85; }
.ar-bubble-report { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.ar-bubble-report .ar-report { margin-left: 0; padding: 0; font-size: .74rem; }
.ar-reported { color: var(--gold); font-weight: 600; }
.ar-thread-note { font-size: .85rem; }
html.ar-page-thread .ar-header { position: static; }   /* the thread keeps its room for the keyboard */
.ar-thread .ar-send { position: sticky; bottom: 0; margin-top: 12px; padding: 10px 0; background: var(--bg); }
#ar-thread-error { margin: 4px 0 0; }
@media (max-width: 600px) { .ar-bubble { max-width: 90%; } }

/* avatars: the store page (avatars.py) */
.ar-av-top { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin: 14px 0; }
.ar-av-pic { image-rendering: pixelated; width: 280px; height: 280px; max-width: 100%; aspect-ratio: 1; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
.ar-av-side { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ar-av-slots { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.ar-av-slots .ar-chip { background: transparent; color: inherit; cursor: pointer; font-family: inherit; }
.ar-av-parts { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ar-av-part { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.ar-av-part.on { border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.ar-av-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.ar-av-pick img { border-radius: 8px; image-rendering: pixelated; }
.ar-av-name { font-size: .85rem; font-weight: 600; text-align: center; }
.ar-av-tag { font-size: .75rem; color: var(--muted); }
.ar-av-owned { color: var(--lime); }
.ar-av-colors { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 14px; }
.ar-av-color { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.ar-av-color.on { border-color: #fff; box-shadow: 0 0 0 2px var(--cyan); }
.ar-av-mini { image-rendering: pixelated; width: 32px; height: 32px; border-radius: 6px; flex: none; vertical-align: middle; background: var(--card); border: 1px solid var(--line); }
.ar-av-mini.ar-av-head { width: 40px; height: 40px; }

/* the player page (ranking.player_page, playerstats.py) and the nickname link in the menu */
a.ar-nick { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
a.ar-nick:hover span, a.ar-nick.on span { color: var(--cyan); }
.ar-nick-av { width: 24px; height: 24px; }
.ar-pp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin: 10px 0 18px; }

.ar-pp-who h1 { margin: 0 0 4px; }
.ar-pp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.ar-badges { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.ar-badge-card { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 10px 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.ar-badge-card img { image-rendering: pixelated; }
.ar-badge-card.locked { opacity: .55; }
.ar-badge-card.locked img { filter: grayscale(1); }
.ar-stat-text { font-size: 1rem !important; }
.ar-recent { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 6px; }
.ar-recent li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }

/* the stage: a wide scene behind the avatar, and the page colours that follow its colour */
.ar-pp-hero { position: relative; height: 280px; overflow: hidden; border-radius: var(--radius); margin: 10px 0 14px;
  border: 2px solid var(--pp-accent, var(--line)); box-shadow: 0 0 22px color-mix(in srgb, var(--pp-accent, transparent) 45%, transparent); background: var(--card); }
.ar-pp-scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; image-rendering: pixelated; }
.ar-pp-hero .ar-pp-avatar { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 280px; height: 280px; max-width: none; image-rendering: pixelated; }
.ar-av-bar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 8px; }
.ar-theme-pink { --pp-accent: #ff2e97; } .ar-theme-cyan { --pp-accent: #00e5ff; } .ar-theme-lime { --pp-accent: #b6ff3c; }
.ar-theme-gold { --pp-accent: #ffd23f; } .ar-theme-violet { --pp-accent: #a45bff; } .ar-theme-orange { --pp-accent: #ff8a3d; }
.ar-theme-white { --pp-accent: #f2f2ff; } .ar-theme-mint { --pp-accent: #5dffc4; }
.ar-pp h1, .ar-pp h2, .ar-av h2 { text-shadow: 0 0 14px color-mix(in srgb, var(--pp-accent, transparent) 55%, transparent); }
.ar-pp h2 { border-left: 4px solid var(--pp-accent, var(--cyan)); padding-left: 10px; }
.ar-pp .ar-stat strong { color: var(--pp-accent, var(--gold)); }
.ar-pp .ar-badge-card:not(.locked) { border-color: var(--pp-accent, var(--line)); }
.ar-av .ar-av-part.on { border-color: var(--pp-accent, var(--cyan)); }

/* the page background of a player (avatar_pages.py): a pattern over the whole page, behind everything */
.ar-page-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .5; pointer-events: none; }
.ar-page-bg[hidden] { display: none; }
.ar-av-premium { color: var(--gold); font-weight: 700; }
.ar-av-live { color: var(--lime); font-weight: 700; }

/* with a page background the content sits on a calm panel, so text never has to be read over the picture */
.ar-pp.has-wall, .ar-av.has-wall { background: color-mix(in srgb, var(--bg) 86%, transparent); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: 0 8px 30px rgba(0, 0, 0, .4); }
.ar-pp.has-wall .ar-muted, .ar-av.has-wall .ar-muted { color: var(--text); opacity: .8; }
