/* =====================================================================
   PROJECT TRACKER — arcade / game-style theme

   MOBILE-FIRST: every base rule below is written for a phone-width
   screen. Wider layouts are added with `min-width` media queries, so a
   small screen never has to undo a desktop rule. Breakpoints used:
     560px  — roomy phone / small tablet (side-by-side inputs)
     700px  — tablet (the feedback table stops being a card list)
     861px  — desktop (the admin editor sits beside the puzzle list)
   ===================================================================== */

:root {
    --neon-cyan:    #00f0ff;
    --neon-magenta: #ff2e97;
    --neon-purple:  #a259ff;
    --neon-green:   #39ff14;
    --neon-yellow:  #ffe600;
    --bg-deep:      #06010f;
    --bg-panel:     rgba(18, 8, 40, 0.72);
    --bg-panel-2:   rgba(28, 14, 56, 0.85);
    --text:         #e8e6ff;
    --text-dim:     #9a92c7;
    --danger:       #ff3b5c;
    --radius:       16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* The [hidden] attribute must always win, even over display rules like
   `.list-item { display: flex }` (used by the JS list filters to hide rows). */
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
    font-family: 'Rajdhani', sans-serif;
    color: var(--text);
    background: var(--bg-deep);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    /* Stop iOS Safari from inflating text after an orientation change. */
    -webkit-text-size-adjust: 100%;
}

/* ---------- Animated arcade background ---------- */
.arcade-bg {
    background:
        radial-gradient(circle at 20% 20%, rgba(162, 89, 255, 0.25), transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(255, 46, 151, 0.22), transparent 45%),
        radial-gradient(circle at 50% 90%, rgba(0, 240, 255, 0.20), transparent 45%),
        linear-gradient(160deg, #0a0320, #06010f 70%);
    background-size: 200% 200%;
    animation: bgshift 18s ease-in-out infinite;
}

@keyframes bgshift {
    0%, 100% { background-position: 0% 0%, 100% 0%, 50% 100%, 0 0; }
    50%      { background-position: 100% 50%, 0% 50%, 50% 0%, 0 0; }
}

/* moving perspective grid */
.grid-overlay {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.08) 1px, transparent 1px);
    background-size: 48px 48px;
    transform: perspective(400px) rotateX(60deg);
    transform-origin: top;
    animation: gridmove 6s linear infinite;
    opacity: 0.5;
}
@keyframes gridmove { from { background-position: 0 0; } to { background-position: 0 48px; } }

/* CRT scanlines */
.scanlines {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background: repeating-linear-gradient(
        to bottom, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px, rgba(0,0,0,0.18) 3px);
    mix-blend-mode: multiply;
}

/* ---------- Layout ---------- */
.stage {
    position: relative; z-index: 2;
    max-width: 760px; margin: 0 auto;
    /* Phone first: small gutters, plus room for the fixed footer and any
       home-indicator inset. */
    padding: 26px 14px calc(84px + env(safe-area-inset-bottom, 0px));
    display: flex; flex-direction: column; gap: 18px;
}
@media (min-width: 560px) {
    .stage { padding: 48px 20px 90px; gap: 28px; }
}
.stage-center { min-height: 100vh; justify-content: center; }

/* ---------- Hero / logo ---------- */
.hero { text-align: center; }
.logo {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: clamp(2rem, 7vw, 3.6rem);
    letter-spacing: 5px;
    line-height: 1.06;
    margin-bottom: 6px;

    /* Chrome / metallic letters: a moving highlight sweep layered over a
       brushed-steel vertical gradient, both clipped to the text. */
    background-image:
        linear-gradient(115deg,
            rgba(255, 255, 255, 0)   38%,
            rgba(255, 255, 255, 0.92) 50%,
            rgba(255, 255, 255, 0)   62%),
        linear-gradient(to bottom,
            #ffffff 0%,
            #d6dce8 22%,
            #99a3b4 44%,
            #6f7a8c 50%,
            #aab4c4 56%,
            #eef2f7 78%,
            #ffffff 100%);
    background-size: 220% 100%, 100% 100%;
    background-position: -60% 0, 0 0;
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;

    /* subtle bevel + a cool glow so it still reads as part of the game UI */
    filter:
        drop-shadow(0 1px 0 rgba(255, 255, 255, 0.35))
        drop-shadow(0 3px 4px rgba(0, 0, 0, 0.55))
        drop-shadow(0 0 16px rgba(120, 170, 230, 0.30));
    animation: chromeSheen 6s ease-in-out infinite;
}
@keyframes chromeSheen {
    0%,
    100% { background-position: -60% 0, 0 0; }
    55%  { background-position: 165% 0, 0 0; }
}
.logo.small { font-size: clamp(1.3rem, 4vw, 1.9rem); letter-spacing: 3px; }

.tagline {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.62rem; letter-spacing: 1px;
    color: var(--neon-yellow);
    text-shadow: 0 0 8px rgba(255, 230, 0, 0.6);
}

/* ---------- Panels ---------- */
.panel {
    background: var(--bg-panel);
    border: 1px solid rgba(0, 240, 255, 0.35);
    border-radius: var(--radius);
    padding: 18px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 24px rgba(0, 240, 255, 0.12), inset 0 0 30px rgba(162, 89, 255, 0.07);
    animation: popin 0.45s cubic-bezier(.2,.9,.3,1.3) both;
}
@keyframes popin { from { opacity:0; transform: translateY(14px) scale(.98); } to { opacity:1; transform:none; } }

@media (min-width: 560px) { .panel { padding: 26px; } }

.login-panel { max-width: 420px; margin: 0 auto; text-align: center; }
.login-panel form { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- Forms ---------- */
.field-label {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.72rem; letter-spacing: 2px;
    color: var(--neon-cyan);
    margin: 16px 0 7px;
    text-transform: uppercase;
}
.field-label .hint { color: var(--text-dim); font-family: 'Rajdhani'; letter-spacing: 0; font-size: 0.78rem; }

.code-input, .text-input, .text-area {
    width: 100%;
    background: rgba(4, 0, 16, 0.7);
    border: 1px solid rgba(162, 89, 255, 0.5);
    border-radius: 10px;
    color: var(--text);
    padding: 13px 16px;
    font-family: 'Rajdhani', sans-serif;
    /* Never below 16px: a smaller font makes iOS Safari zoom on focus. */
    font-size: 1.05rem;
    transition: box-shadow .2s, border-color .2s;
}
.code-input {
    font-family: 'Orbitron', monospace;
    letter-spacing: 3px;
    text-transform: uppercase;
}
.text-area { resize: vertical; line-height: 1.4; }
.code-input:focus, .text-input:focus, .text-area:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 2px rgba(0,240,255,.25), 0 0 18px rgba(0,240,255,.35);
}
::placeholder { color: var(--text-dim); opacity: .7; }

/* Stacked on a phone — a side-by-side button squeezes the code box down to
   a couple of characters. It becomes a row as soon as there is width for it. */
.code-row { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.code-row .btn { width: 100%; }
@media (min-width: 560px) {
    .code-row { flex-direction: row; }
    .code-row .code-input { flex: 1; }
    .code-row .btn { width: auto; }
}
.full { width: 100%; }

/* ---------- Buttons ---------- */
.btn {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700; letter-spacing: 2px;
    border: none; border-radius: 10px;
    padding: 13px 22px;
    cursor: pointer;
    color: #06010f;
    text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center;
    transition: transform .12s, box-shadow .2s, filter .2s;
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 0.85rem;
    /* Big enough to hit with a thumb. */
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.1); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.sm { padding: 8px 14px; font-size: 0.7rem; min-height: 36px; }
/* Hover lift is a pointer affordance; on touch it just leaves buttons stuck
   in a "hovered" state after a tap. */
@media (hover: none) {
    .btn:hover { transform: none; filter: none; }
}

.btn-primary { background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple)); box-shadow: 0 0 18px rgba(0,240,255,.5); }
.btn-success { background: linear-gradient(135deg, var(--neon-green), var(--neon-cyan)); box-shadow: 0 0 18px rgba(57,255,20,.45); }
.btn-danger  { background: linear-gradient(135deg, var(--danger), var(--neon-magenta)); color:#fff; box-shadow: 0 0 16px rgba(255,59,92,.4); }
.btn-ghost   { background: transparent; color: var(--neon-cyan); border: 1px solid var(--neon-cyan); }
.btn-ghost:hover { background: rgba(0,240,255,.1); }
.btn.copied { color: var(--neon-green); border-color: var(--neon-green); background: rgba(57,255,20,.15); }

.btn.loading { pointer-events: none; opacity: .7; }
.btn.loading .btn-label::after { content: ' ...'; animation: blink 1s steps(3) infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- Error / flash ---------- */
.error-msg {
    color: var(--danger); margin-top: 10px; min-height: 1em;
    font-weight: 600; opacity: 0; transition: opacity .2s;
}
.error-msg.show { opacity: 1; }
.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-8px)} 40%,80%{transform:translateX(8px)} }

.flash {
    position: relative; z-index: 2;
    max-width: 1100px; margin: 14px auto 0;
    padding: 14px 20px; border-radius: 10px;
    font-weight: 600; text-align: center;
}
.flash-success { background: rgba(57,255,20,.15); border:1px solid var(--neon-green); color: var(--neon-green); }
.flash-error   { background: rgba(255,59,92,.15); border:1px solid var(--danger); color: #ff8095; }

/* ---------- Project card ---------- */
.project-card { position: relative; overflow: hidden; }
.card-glow {
    position: absolute; inset: -50%; z-index: -1;
    background: conic-gradient(from 0deg, transparent, rgba(0,240,255,.12), transparent 30%);
    animation: spin 8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.project-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.badge {
    font-family: 'Orbitron', monospace; font-weight: 700;
    background: linear-gradient(135deg, var(--neon-magenta), var(--neon-purple));
    color: #fff; padding: 6px 14px; border-radius: 8px;
    letter-spacing: 2px; font-size: 0.85rem;
    box-shadow: 0 0 14px rgba(255,46,151,.5);
}
.badge.sm { font-size: 0.7rem; padding: 4px 10px; }
.project-title {
    font-family: 'Orbitron', sans-serif; font-weight: 700;
    font-size: clamp(1.3rem, 4vw, 2rem); color: #fff;
    text-shadow: 0 0 12px rgba(162,89,255,.6);
}

.block { margin-top: 22px; }
.block-title {
    font-family: 'Orbitron', sans-serif; font-size: 0.85rem; letter-spacing: 2px;
    color: var(--neon-cyan); margin-bottom: 8px; text-transform: uppercase;
}
.block-title.big { font-size: 1.05rem; margin-bottom: 18px; }
.block-body { font-size: 1.1rem; line-height: 1.55; color: var(--text); white-space: pre-wrap; word-break: break-word; }

.instruction-block {
    background: rgba(255, 230, 0, 0.06);
    border-left: 3px solid var(--neon-yellow);
    padding: 14px 16px; border-radius: 8px;
}
.instruction-block .block-title { color: var(--neon-yellow); }

/* ---------- Notes toggle ---------- */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.slider {
    width: 52px; height: 28px; border-radius: 99px;
    background: rgba(4,0,16,.8); border: 1px solid var(--neon-purple);
    position: relative; transition: background .25s, box-shadow .25s;
}
.slider::before {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--neon-purple); transition: transform .25s, background .25s;
}
.switch input:checked + .slider { background: rgba(57,255,20,.2); box-shadow: 0 0 14px rgba(57,255,20,.5); border-color: var(--neon-green); }
.switch input:checked + .slider::before { transform: translateX(24px); background: var(--neon-green); }
.switch-text { font-family: 'Orbitron'; font-size: 0.72rem; letter-spacing: 1px; color: var(--text-dim); }

/* Notes viewer — one note revealed at a time, in order */
.notes-viewer { margin-top: 14px; }
.note-counter {
    font-family: 'Orbitron', sans-serif; font-size: 0.72rem; letter-spacing: 2px;
    color: var(--neon-purple); margin-bottom: 8px;
}
.note-item {
    background: rgba(162,89,255,.08);
    border: 1px solid rgba(162,89,255,.3);
    border-radius: 10px; padding: 14px 16px;
    font-size: 1.05rem; line-height: 1.55; word-break: break-word;
    min-height: 1.5em;
}
.note-animate { animation: slidein .35s ease both; }
@keyframes slidein { from { opacity:0; transform: translateX(-12px);} to {opacity:1; transform:none;} }
.note-nav { display: flex; gap: 10px; margin-top: 12px; }
.note-nav .btn[disabled] { opacity: .35; pointer-events: none; }
.notes-empty { color: var(--text-dim); font-style: italic; margin-top: 10px; }

/* Rich-text content rendering (description + notes) */
.rich p { margin: 0 0 .6em; }
.rich p:last-child { margin-bottom: 0; }
.rich ul, .rich ol { margin: .3em 0 .6em; padding-left: 1.5em; }
.rich li { margin: .15em 0; }
.rich a { color: var(--neon-cyan); text-decoration: underline; }
.rich a:hover { color: var(--neon-magenta); }
.rich h3, .rich h4 { font-family: 'Orbitron', sans-serif; color: #fff; margin: .4em 0 .3em; }
.rich blockquote {
    margin: .4em 0; padding: 6px 14px;
    border-left: 3px solid var(--neon-purple); color: var(--text-dim);
}

/* ---------- Completion ---------- */
.completion-block {
    background: rgba(0,240,255,.05);
    border: 1px dashed rgba(0,240,255,.4);
    border-radius: 12px; padding: 16px;
}
/* Tight tracking so the "ENTER SOLUTION CODE" placeholder fits a phone;
   it opens back up once there is room. */
.completion-input { letter-spacing: 0.5px; }
@media (min-width: 560px) {
    .completion-input { letter-spacing: 2px; }
}
.completion-reveal {
    margin-top: 18px; padding: 20px; text-align: center;
    background: linear-gradient(135deg, rgba(57,255,20,.12), rgba(0,240,255,.12));
    border: 1px solid var(--neon-green); border-radius: 12px;
    position: relative; overflow: hidden;
    animation: reveal .6s cubic-bezier(.2,.9,.3,1.3) both;
}
@keyframes reveal { from { opacity:0; transform: scale(.9);} to {opacity:1; transform:none;} }
.reveal-title {
    font-family: 'Orbitron'; color: var(--neon-green);
    letter-spacing: 2px; margin-bottom: 12px;
    text-shadow: 0 0 12px rgba(57,255,20,.6);
}
/* Keep the title centered but let rich body content (lists, paragraphs) read left-aligned. */
.completion-reveal .rich { text-align: left; display: inline-block; }

/* confetti */
.confetti-burst { position: absolute; inset: 0; pointer-events: none; }
.confetti-burst i {
    position: absolute; top: 0; width: 8px; height: 14px; opacity: 0;
    animation: confetti 1.6s ease-out forwards;
}
@keyframes confetti {
    0% { opacity: 1; transform: translateY(-10px) rotate(0); }
    100% { opacity: 0; transform: translateY(220px) rotate(540deg); }
}

#resetBtn { margin-top: 24px; }

/* ---------- Admin ---------- */
/* No admin link on the public screen — admin.php is reached by URL only. */
.back-link { display: inline-block; margin-top: 16px; color: var(--text-dim); text-decoration: none; }
.back-link:hover { color: var(--neon-cyan); }

.admin-top {
    position: relative; z-index: 2;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    max-width: 1100px; margin: 0 auto; padding: 20px 14px 0;
}
@media (min-width: 561px) { .admin-top { padding: 26px 20px 0; } }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.admin-grid {
    position: relative; z-index: 2;
    max-width: 1100px; margin: 22px auto 80px; padding: 0 14px;
    display: grid; grid-template-columns: 1fr; gap: 22px;
    align-items: start;
}
@media (min-width: 861px) {
    .admin-grid { grid-template-columns: 1.3fr 1fr; padding: 0 20px; }
}

.editor-form { display: flex; flex-direction: column; }
.note-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 10px; }
.note-row .text-area, .note-row .rte { flex: 1; min-width: 0; }
.note-handle { display: flex; flex-direction: column; gap: 4px; }
.note-handle .btn { padding: 4px 8px; font-size: 0.6rem; line-height: 1; }
.divider { border: none; border-top: 1px solid rgba(162,89,255,.3); margin: 22px 0 4px; }

/* ---------- Rich-text editor (admin) ---------- */
.rte {
    background: rgba(4,0,16,.7);
    border: 1px solid rgba(162,89,255,.5);
    border-radius: 10px;
    overflow: hidden;
}
.rte:focus-within { border-color: var(--neon-cyan); box-shadow: 0 0 0 2px rgba(0,240,255,.2); }
.rte-toolbar {
    display: flex; flex-wrap: wrap; gap: 4px;
    padding: 6px 8px;
    background: rgba(162,89,255,.12);
    border-bottom: 1px solid rgba(162,89,255,.3);
}
.rte-btn {
    min-width: 30px; padding: 4px 8px;
    background: rgba(4,0,16,.6); color: var(--text);
    border: 1px solid rgba(162,89,255,.4); border-radius: 6px;
    font-family: 'Rajdhani', sans-serif; font-size: 0.85rem; cursor: pointer;
    transition: background .15s, border-color .15s;
}
.rte-btn:hover { background: rgba(0,240,255,.18); border-color: var(--neon-cyan); }
.rte-editable {
    min-height: 70px; padding: 12px 14px;
    color: var(--text); font-size: 1rem; line-height: 1.5;
    outline: none; word-break: break-word;
}
.rte-editable:empty::before {
    content: 'Type here…'; color: var(--text-dim); opacity: .6;
}
.rte-editable ul, .rte-editable ol { padding-left: 1.5em; margin: .3em 0; }
.rte-editable a { color: var(--neon-cyan); }
.editor-buttons { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.editor-buttons .btn { flex: 1 1 160px; }
@media (min-width: 561px) { .editor-buttons .btn { flex: 0 0 auto; } }

.list-filters { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.list-filters #filterSearch { flex: 1 1 180px; }
.list-filters #filterType { flex: 0 1 180px; }

.project-list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: rgba(162,89,255,.07); border: 1px solid rgba(162,89,255,.25);
    border-radius: 10px; padding: 12px 14px; flex-wrap: wrap;
}
.list-info { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.list-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.type-tag {
    font-family: 'Rajdhani'; font-size: 0.72rem; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; white-space: nowrap;
    color: var(--neon-green); padding: 3px 8px; border-radius: 999px;
    border: 1px solid rgba(57,255,20,.4); background: rgba(57,255,20,.08);
}
.list-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list-actions form { display: inline; }
.feedback-flag {
    font-size: 1.05rem; line-height: 1; cursor: default;
    filter: drop-shadow(0 0 6px rgba(255, 230, 0, 0.7));
}

/* ---------- Footer ---------- */
.footer {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 2;
    text-align: center; padding: 10px;
    font-family: 'Orbitron'; font-size: 0.65rem; letter-spacing: 1px;
    color: var(--text-dim);
    background: linear-gradient(to top, rgba(6,1,15,.9), transparent);
}
.online { color: var(--neon-green); text-shadow: 0 0 8px rgba(57,255,20,.6); animation: blink 2s infinite; }

/* ---------- Reveal gate (blurred "Reveal Solution?" overlay) ----------
   Wraps any solution content — an image, a PDF frame or rich text — and keeps
   it blurred behind a frosted overlay until the visitor clicks to reveal.
   The overlay is opaque enough on its own that nothing leaks through even if
   the browser refuses to apply `filter` to an embedded PDF. */
.reveal-shell { position: relative; }
.reveal-shell.locked {
    overflow: hidden; border-radius: 12px;
    min-height: 170px;
    border: 1px solid rgba(0,240,255,.28);
    background: rgba(4,0,16,.5);
}
.file-reveal.locked { min-height: 220px; }
@media (min-width: 700px) { .file-reveal.locked { min-height: 300px; } }

/* The content itself: blurred + inert while the gate is closed. */
.reveal-shell.locked .reveal-content {
    filter: blur(16px) saturate(.55);
    /* Scale past the edges so the blur doesn't feather in from the border. */
    transform: scale(1.04);
    pointer-events: none; user-select: none;
}
/* A gated PDF frame has no src yet, so hide the blank white box behind the
   overlay instead of letting it glow through the frost. */
.reveal-shell.locked .file-frame { height: 300px; min-height: 0; visibility: hidden; }

/* The clickable frosted overlay. */
.reveal-overlay {
    position: absolute; inset: 0; z-index: 2;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 10px;
    padding: 20px; cursor: pointer;
    border: none; border-radius: 12px;
    background: rgba(6,1,15,.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text);
    transition: background .2s, box-shadow .2s;
    /* Deliberately no entry animation: the gate must be fully opaque from the
       first painted frame, even in a throttled/background tab where CSS
       animations are held at their `from` state. */
}
.reveal-shell:not(.locked) .reveal-overlay { display: none; }
.reveal-overlay:hover,
.reveal-overlay:focus-visible {
    background: rgba(6,1,15,.5);
    box-shadow: inset 0 0 40px rgba(0,240,255,.22);
    outline: none;
}

.reveal-glass { display: block; width: 62px; height: 62px; }
.reveal-glass svg {
    width: 100%; height: 100%;
    fill: none; stroke: var(--neon-cyan); stroke-width: 5;
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px rgba(0,240,255,.7));
    animation: glass-sweep 3.2s ease-in-out infinite;
    transition: transform .2s;
}
.reveal-overlay:hover .reveal-glass svg,
.reveal-overlay:focus-visible .reveal-glass svg {
    animation-play-state: paused;
    transform: scale(1.14);
    stroke: var(--neon-green);
    filter: drop-shadow(0 0 12px rgba(57,255,20,.8));
}
@keyframes glass-sweep {
    0%, 100% { transform: translate(-6px, 0) rotate(-8deg); }
    50%      { transform: translate(6px, -3px) rotate(8deg); }
}

.reveal-text {
    font-family: 'Orbitron', sans-serif; font-weight: 700;
    font-size: clamp(.95rem, 3.2vw, 1.25rem); letter-spacing: 2px;
    color: #fff; text-align: center;
    text-shadow: 0 0 14px rgba(0,240,255,.75);
}
.reveal-hint {
    font-family: 'Orbitron', sans-serif; font-size: .62rem; letter-spacing: 2px;
    color: var(--text-dim); text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
    .reveal-glass svg { animation: none; }
}

/* ---------- File viewer (tracker) ---------- */
.file-viewer { margin-top: 12px; }
.file-image {
    display: block; max-width: 100%; border-radius: 10px;
    border: 1px solid rgba(0,240,255,.35);
    box-shadow: 0 0 18px rgba(0,240,255,.12);
}
.file-frame {
    width: 100%; height: 60vh; min-height: 320px;
    border: 1px solid rgba(0,240,255,.35); border-radius: 10px;
    background: #fff;
}
@media (min-width: 700px) {
    .file-frame { height: 70vh; min-height: 460px; }
}
#fileOpen { text-decoration: none; }

/* ---------- File upload (admin) ---------- */
.current-file {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 8px;
}
.current-file a { color: var(--neon-cyan); }
.file-pill {
    font-family: 'Orbitron', sans-serif; font-size: 0.65rem; letter-spacing: 1px;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    color: #06010f; padding: 3px 9px; border-radius: 6px;
}
.remove-file-label {
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--text-dim); font-size: 0.9rem; cursor: pointer;
}
.file-input {
    width: 100%; color: var(--text);
    background: rgba(4,0,16,.7);
    border: 1px solid rgba(162,89,255,.5); border-radius: 10px;
    padding: 10px 12px; font-family: 'Rajdhani', sans-serif;
}
.file-input::file-selector-button {
    margin-right: 12px; padding: 7px 14px;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    color: #06010f; border: none; border-radius: 8px;
    font-family: 'Orbitron', sans-serif; font-size: 0.72rem; letter-spacing: 1px;
    cursor: pointer;
}

/* ---------- Feedback form (tracker) ---------- */
.feedback-block {
    background: rgba(162, 89, 255, 0.05);
    border: 1px dashed rgba(162, 89, 255, 0.4);
    border-radius: 12px; padding: 16px;
}
.feedback-block .block-title { color: var(--neon-purple); }
.feedback-form { display: flex; flex-direction: column; }
.star-rating { display: inline-flex; gap: 4px; margin: 4px 0 14px; }
.star {
    background: none; border: none; cursor: pointer; padding: 0 2px;
    font-size: 2.1rem; line-height: 1;
    color: rgba(154, 146, 199, 0.4);
    transition: color .12s, transform .12s, text-shadow .12s;
}
.star:hover { transform: scale(1.15); }
.star.on {
    color: var(--neon-yellow);
    text-shadow: 0 0 10px rgba(255, 230, 0, 0.7);
}
.feedback-comment { margin-bottom: 14px; }
#feedbackSubmit { align-self: flex-start; }
.feedback-thanks {
    margin-top: 6px; padding: 20px; text-align: center;
    background: linear-gradient(135deg, rgba(57,255,20,.12), rgba(162,89,255,.12));
    border: 1px solid var(--neon-green); border-radius: 12px;
    animation: reveal .6s cubic-bezier(.2,.9,.3,1.3) both;
}

/* ---------- Newsletter sign-up (tracker) ---------- */
.newsletter-block {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.06), rgba(162, 89, 255, 0.06));
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 12px; padding: 18px;
}
.newsletter-block .block-title { color: var(--neon-cyan); }
.newsletter-sub {
    margin: 2px 0 14px;
    font-size: 0.95rem; color: var(--text-dim);
}
.newsletter-fields { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.newsletter-fields .text-input { min-width: 0; }
@media (min-width: 560px) {
    .newsletter-fields { flex-direction: row; flex-wrap: wrap; }
    .newsletter-fields .text-input { flex: 1 1 180px; }
    .newsletter-fields .btn { flex: 0 0 auto; width: auto; }
}
.newsletter-disclaimer {
    margin: 10px 0 0;
    font-size: 0.82rem; color: var(--text-dim); opacity: .85;
}
.newsletter-thanks {
    padding: 18px; text-align: center;
    background: linear-gradient(135deg, rgba(57,255,20,.12), rgba(0,240,255,.12));
    border: 1px solid var(--neon-green); border-radius: 12px;
    animation: reveal .6s cubic-bezier(.2,.9,.3,1.3) both;
}
.newsletter-thanks .newsletter-disclaimer { margin-top: 6px; }

/* ---------- Admin tabs ---------- */
.admin-tabs {
    position: relative; z-index: 2;
    max-width: 1100px; margin: 20px auto 0; padding: 0 14px;
    display: flex; gap: 8px; flex-wrap: wrap;
}
@media (min-width: 561px) { .admin-tabs { padding: 0 20px; gap: 10px; } }
.admin-tab {
    font-family: 'Orbitron', sans-serif; font-weight: 700; letter-spacing: 1.5px;
    font-size: 0.78rem; text-transform: uppercase;
    color: var(--text-dim); cursor: pointer;
    background: rgba(18, 8, 40, 0.6);
    border: 1px solid rgba(162, 89, 255, 0.35);
    border-radius: 10px 10px 0 0; padding: 12px 20px;
    transition: color .2s, background .2s, border-color .2s, box-shadow .2s;
}
.admin-tab:hover { color: var(--neon-cyan); border-color: rgba(0,240,255,.5); }
.admin-tab.is-active {
    color: var(--neon-cyan);
    background: var(--bg-panel);
    border-color: rgba(0, 240, 255, 0.55);
    box-shadow: 0 -2px 14px rgba(0, 240, 255, 0.18);
}
.tab-count {
    display: inline-block; min-width: 20px; margin-left: 4px;
    font-family: 'Rajdhani', sans-serif; font-size: 0.8rem;
    color: #06010f; background: var(--neon-yellow);
    border-radius: 999px; padding: 0 7px;
}
.admin-single {
    position: relative; z-index: 2;
    max-width: 1100px; margin: 0 auto 80px; padding: 0 14px;
}
@media (min-width: 561px) { .admin-single { padding: 0 20px; } }
.admin-grid.tab-panel { margin-top: 0; }

/* ---------- Feedback table (admin) ----------
   Phone first: each submission is a stacked card, with the column name
   coming from the cell's data-label. From 700px it becomes a real table. */
.feedback-table-wrap { overflow-x: auto; }
.feedback-table {
    width: 100%; border-collapse: collapse; margin-top: 6px;
    font-family: 'Rajdhani', sans-serif;
}
.feedback-table, .feedback-table tbody, .feedback-table tr, .feedback-table td {
    display: block; width: 100%;
}
.feedback-table thead { display: none; } /* labels come from data-label instead */
.feedback-table tr.feedback-row {
    background: rgba(162, 89, 255, 0.07);
    border: 1px solid rgba(162, 89, 255, 0.25);
    border-radius: 10px; padding: 6px 4px; margin-bottom: 10px;
}
.feedback-table td {
    text-align: left; padding: 7px 12px; border-bottom: none;
    vertical-align: top;
}
.feedback-table td::before {
    content: attr(data-label);
    display: block;
    font-family: 'Orbitron', sans-serif; font-size: 0.6rem; letter-spacing: 1.5px;
    text-transform: uppercase; color: var(--neon-cyan); opacity: .8;
    margin-bottom: 2px;
}
.feedback-row { cursor: pointer; transition: background .15s; }
.feedback-row:hover, .feedback-row:focus {
    background: rgba(0, 240, 255, 0.08); outline: none;
}
.fb-stars { color: var(--neon-yellow); letter-spacing: 2px; white-space: nowrap; font-size: 1.05rem; }
.fb-comment { color: var(--text); word-break: break-word; }
.fb-title { font-weight: 600; }
.fb-date { color: var(--text-dim); font-size: 0.9rem; }
.fb-muted { color: var(--text-dim); font-style: italic; }

@media (min-width: 700px) {
    .feedback-table { display: table; border-collapse: collapse; }
    .feedback-table thead { display: table-header-group; }
    .feedback-table tbody { display: table-row-group; }
    .feedback-table tr, .feedback-table tr.feedback-row {
        display: table-row;
        background: none; border: none; border-radius: 0; padding: 0; margin: 0;
    }
    .feedback-table td { display: table-cell; width: auto; }
    .feedback-table td::before { display: none; }
    .feedback-table th, .feedback-table td {
        padding: 12px 14px;
        border-bottom: 1px solid rgba(162, 89, 255, 0.2);
    }
    .feedback-table th {
        font-family: 'Orbitron', sans-serif; font-size: 0.7rem; letter-spacing: 1.5px;
        text-transform: uppercase; color: var(--neon-cyan);
        border-bottom: 1px solid rgba(0, 240, 255, 0.4);
        text-align: left; vertical-align: top;
    }
    .feedback-row:hover, .feedback-row:focus { background: rgba(0, 240, 255, 0.08); }
    .fb-col-rating { width: 110px; }
    .fb-col-difficulty { width: 130px; }
    .fb-col-date { width: 170px; white-space: nowrap; }
    .fb-comment {
        max-width: 300px;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .fb-date { white-space: nowrap; }
}

/* ---------- Feedback dialog (admin) ---------- */
.fb-dialog {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    border: none; padding: 0; background: transparent;
    max-width: 520px; width: calc(100% - 40px);
    color: var(--text);
}
.fb-dialog::backdrop { background: rgba(6, 1, 15, 0.72); backdrop-filter: blur(3px); }
.fb-dialog-inner {
    background: var(--bg-panel-2);
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: var(--radius); padding: 26px;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.2);
}
.fb-dialog-stars { color: var(--neon-yellow); font-size: 1.7rem; letter-spacing: 3px; text-shadow: 0 0 10px rgba(255,230,0,.5); }
.fb-dialog-title {
    font-family: 'Orbitron', sans-serif; color: #fff; font-size: 1.1rem;
    margin: 12px 0 4px;
}
.fb-dialog-date { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 14px; }
.fb-dialog-comment {
    font-size: 1.05rem; line-height: 1.55; word-break: break-word;
    white-space: pre-wrap;
    background: rgba(4, 0, 16, 0.5);
    border: 1px solid rgba(162, 89, 255, 0.3); border-radius: 10px;
    padding: 14px 16px; margin-bottom: 18px;
    max-height: 50vh; overflow-y: auto;
}
#fbDlgClose { display: block; margin-left: auto; }

/* ---------- "How this portal works" link + spoiler link ----------
   A quiet text link that reads as a link, not a button. Shared by the
   help link above the puzzle and the emergency reveal under the code box. */
.how-row { display: flex; justify-content: center; margin: -6px 0 0; }
.how-link {
    display: inline-flex; align-items: center; gap: 8px;
    background: none; border: none; cursor: pointer;
    padding: 8px 10px; min-height: 44px;
    font-family: 'Rajdhani', sans-serif; font-weight: 600;
    font-size: 0.95rem; color: var(--text-dim);
    text-decoration: underline; text-underline-offset: 3px;
    text-decoration-color: rgba(154, 146, 199, 0.5);
    transition: color .15s;
    -webkit-tap-highlight-color: transparent;
}
.how-link:hover, .how-link:focus-visible { color: var(--neon-cyan); outline: none; }
.how-q {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; flex: 0 0 22px;
    border-radius: 50%;
    border: 1px solid var(--neon-cyan); color: var(--neon-cyan);
    font-family: 'Orbitron', sans-serif; font-size: 0.75rem; font-weight: 700;
    line-height: 1;
}
.how-link:hover .how-q, .how-link:focus-visible .how-q {
    background: rgba(0, 240, 255, .15);
    box-shadow: 0 0 10px rgba(0, 240, 255, .5);
}
.danger-link { color: var(--text-dim); }
.danger-link:hover, .danger-link:focus-visible { color: var(--danger); }
.danger-q { border-color: var(--danger); color: var(--danger); }
.danger-link:hover .danger-q, .danger-link:focus-visible .danger-q {
    background: rgba(255, 59, 92, .15);
    box-shadow: 0 0 10px rgba(255, 59, 92, .5);
}

/* ---------- "How this portal works" modal ---------- */
.how-dialog {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    border: none; padding: 0; background: transparent;
    width: calc(100% - 24px); max-width: 560px;
    max-height: calc(100dvh - 32px);
    color: var(--text);
}
.how-dialog::backdrop { background: rgba(6, 1, 15, 0.78); backdrop-filter: blur(3px); }
.how-dialog-inner {
    background: var(--bg-panel-2);
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: var(--radius);
    padding: 20px 18px;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.2);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
@media (min-width: 560px) { .how-dialog-inner { padding: 28px 26px; } }
.how-dialog-title {
    font-family: 'Orbitron', sans-serif; font-size: clamp(1rem, 4.5vw, 1.25rem);
    letter-spacing: 2px; color: var(--neon-cyan);
    text-shadow: 0 0 12px rgba(0, 240, 255, .45);
    margin-bottom: 10px;
}
.how-intro { color: var(--text-dim); line-height: 1.55; margin-bottom: 16px; }
.how-steps { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.how-steps li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.5; }
.how-steps strong { color: #fff; display: block; }
.how-steps em { color: var(--neon-yellow); font-style: normal; font-weight: 600; }
.how-step-n {
    flex: 0 0 28px;
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-magenta), var(--neon-purple));
    color: #fff; font-family: 'Orbitron', sans-serif; font-size: 0.8rem; font-weight: 700;
    box-shadow: 0 0 12px rgba(255, 46, 151, .45);
}
.how-foot {
    margin: 18px 0; padding-top: 14px;
    border-top: 1px solid rgba(162, 89, 255, .3);
    color: var(--text-dim); font-size: 0.92rem; line-height: 1.5;
}

/* ---------- Puzzle banner (horizontal header image) ----------
   Sits directly under the title and is never gated: if a puzzle has one,
   it shows the moment the puzzle loads. */
.puzzle-banner { margin: 0 0 4px; }
.puzzle-banner-img {
    display: block; width: 100%; height: auto;
    border-radius: 12px;
    border: 1px solid rgba(0, 240, 255, 0.35);
    box-shadow: 0 0 22px rgba(0, 240, 255, 0.14);
    animation: reveal .5s cubic-bezier(.2,.9,.3,1.3) both;
}

/* ---------- Emergency "reveal the answer" ---------- */
.reveal-answer { margin-top: 10px; text-align: center; }
.spoiler-warning {
    margin-top: 10px; padding: 16px;
    text-align: left;
    background: rgba(255, 59, 92, 0.08);
    border: 1px solid rgba(255, 59, 92, 0.55);
    border-radius: 12px;
    animation: reveal .35s cubic-bezier(.2,.9,.3,1.3) both;
}
.spoiler-title {
    font-family: 'Orbitron', sans-serif; font-size: 0.85rem; letter-spacing: 2px;
    color: var(--danger); margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(255, 59, 92, .5);
}
.spoiler-body { line-height: 1.55; color: var(--text); margin-bottom: 14px; }
.spoiler-actions { display: flex; flex-direction: column; gap: 10px; }
.spoiler-actions .btn { width: 100%; }
@media (min-width: 560px) {
    .spoiler-actions { flex-direction: row-reverse; justify-content: flex-start; }
    .spoiler-actions .btn { width: auto; }
}

/* A revealed (rather than solved) answer gets amber, not victory green. */
.completion-reveal.is-spoiled {
    background: linear-gradient(135deg, rgba(255, 230, 0, .10), rgba(255, 59, 92, .10));
    border-color: var(--neon-yellow);
}
.completion-reveal.is-spoiled .reveal-title {
    color: var(--neon-yellow);
    text-shadow: 0 0 12px rgba(255, 230, 0, .6);
}

/* "You used 2 out of 5 hints before revealing the answer." (reveal path only) */
.hints-used {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.72rem; letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--text-dim);
    margin: -4px 0 12px;
}

/* ---------- Next puzzle / mystery CTA ---------- */
.cta-block {
    background: linear-gradient(135deg, rgba(255, 46, 151, .10), rgba(162, 89, 255, .10));
    border: 1px solid rgba(255, 46, 151, 0.45);
    border-radius: 12px; padding: 18px;
    text-align: center;
    animation: reveal .5s cubic-bezier(.2,.9,.3,1.3) both;
}
.cta-block .block-title { color: var(--neon-magenta); }
.cta-block.cta-mystery {
    background: linear-gradient(135deg, rgba(162, 89, 255, .12), rgba(0, 240, 255, .10));
    border-color: rgba(162, 89, 255, 0.55);
}
.cta-block.cta-mystery .block-title { color: var(--neon-purple); }
.cta-body { line-height: 1.55; color: var(--text); margin-bottom: 14px; }
.cta-btn { width: 100%; }
@media (min-width: 560px) { .cta-btn { width: auto; } }
.cta-shop {
    display: block; margin-top: 12px;
    color: var(--text-dim); font-size: 0.9rem;
    text-decoration: underline; text-underline-offset: 3px;
}
.cta-shop:hover { color: var(--neon-cyan); }

/* ---------- Platform review request (tracker) ----------
   Stands where the star-rating form would be, for buyers who arrived on a
   platform that takes public reviews (Etsy). Reuses .cta-body / .cta-btn. */
.review-block {
    background: linear-gradient(135deg, rgba(255, 230, 0, .10), rgba(255, 46, 151, .08));
    border: 1px solid rgba(255, 230, 0, 0.45);
    border-radius: 12px; padding: 18px;
    text-align: center;
    animation: reveal .5s cubic-bezier(.2,.9,.3,1.3) both;
}
.review-block .block-title { color: var(--neon-yellow); }

/* ---------- Difficulty vote (tracker) ---------- */
.difficulty-label {
    font-family: 'Orbitron', sans-serif; font-size: 0.72rem; letter-spacing: 1.5px;
    text-transform: uppercase; color: var(--text-dim);
    margin-bottom: 8px;
}
.difficulty-options {
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 14px;
}
@media (min-width: 480px) {
    .difficulty-options { flex-direction: row; }
    .difficulty-options .diff-opt { flex: 1 1 0; justify-content: center; }
}
.diff-opt {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 10px 14px;
    background: rgba(4, 0, 16, .55);
    border: 1px solid rgba(162, 89, 255, .45);
    border-radius: 10px;
    color: var(--text); cursor: pointer;
    font-family: 'Rajdhani', sans-serif; font-size: 0.98rem; font-weight: 600;
    transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
    -webkit-tap-highlight-color: transparent;
}
.diff-opt:hover, .diff-opt:focus-visible {
    border-color: var(--neon-cyan); outline: none;
}
.diff-opt.on {
    border-color: var(--neon-green);
    background: rgba(57, 255, 20, .14);
    color: #fff;
    box-shadow: 0 0 14px rgba(57, 255, 20, .3);
}
.diff-icon { font-size: 1.15rem; line-height: 1; }

/* ---------- Difficulty tag (admin) ---------- */
.diff-tag {
    display: inline-block; white-space: nowrap;
    font-family: 'Rajdhani', sans-serif; font-size: 0.75rem; font-weight: 700;
    letter-spacing: .5px; padding: 3px 9px; border-radius: 999px;
    border: 1px solid rgba(154, 146, 199, .5); color: var(--text-dim);
}
.diff-tag.diff-too_easy   { color: var(--neon-cyan);   border-color: rgba(0, 240, 255, .5);  background: rgba(0, 240, 255, .08); }
.diff-tag.diff-just_right { color: var(--neon-green);  border-color: rgba(57, 255, 20, .5);  background: rgba(57, 255, 20, .08); }
.diff-tag.diff-too_hard   { color: var(--neon-yellow); border-color: rgba(255, 230, 0, .55); background: rgba(255, 230, 0, .08); }
.fb-dialog-difficulty { margin: -8px 0 14px; }

/* ---------- Admin: image size tip + title switch ---------- */
.size-tip {
    margin: 0 0 10px;
    padding: 10px 12px;
    background: rgba(0, 240, 255, .06);
    border-left: 3px solid var(--neon-cyan);
    border-radius: 8px;
    font-size: 0.88rem; line-height: 1.5; color: var(--text-dim);
}
.size-tip strong { color: var(--neon-cyan); }
.title-switch { margin-top: 14px; }
.editor-form .hint { color: var(--text-dim); font-size: 0.85rem; margin: 6px 0 0; }
.editor-form code {
    font-family: 'Rajdhani', monospace; font-size: 0.9em;
    color: var(--neon-cyan); background: rgba(0, 240, 255, .08);
    padding: 1px 5px; border-radius: 4px;
}

/* ---------- Admin: analytics tab ----------
   Phone first: the platform cards stack, and the per-puzzle table is a
   list of cards labelled from each cell's data-label. From 700px the
   table becomes a real table (same pattern as the feedback table). */
.stat-grid {
    display: grid; grid-template-columns: 1fr; gap: 12px;
    margin: 4px 0 26px;
}
@media (min-width: 620px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
    background: rgba(162, 89, 255, .07);
    border: 1px solid rgba(162, 89, 255, .3);
    border-radius: 12px; padding: 14px 16px;
}
.stat-card.stat-etsy    { border-color: rgba(255, 46, 151, .45); background: rgba(255, 46, 151, .07); }
.stat-card.stat-patreon { border-color: rgba(255, 230, 0, .4);   background: rgba(255, 230, 0, .06); }
.stat-card.stat-total   { border-color: rgba(0, 240, 255, .5);   background: rgba(0, 240, 255, .08); }
.stat-title {
    font-family: 'Orbitron', sans-serif; font-size: 0.72rem; letter-spacing: 1.6px;
    color: var(--neon-purple); margin-bottom: 10px;
}
.stat-etsy .stat-title    { color: var(--neon-magenta); }
.stat-patreon .stat-title { color: var(--neon-yellow); }
.stat-total .stat-title   { color: var(--neon-cyan); }
.stat-row {
    display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    padding: 5px 0; border-bottom: 1px solid rgba(162, 89, 255, .15);
}
.stat-row:last-child { border-bottom: none; }
.stat-row dt { color: var(--text-dim); font-size: 0.92rem; }
.stat-row dd {
    font-family: 'Orbitron', sans-serif; font-size: 1.05rem; color: var(--text);
}

.analytics-table-wrap { overflow-x: auto; }
.analytics-table {
    width: 100%; border-collapse: collapse; margin-top: 6px;
    font-family: 'Rajdhani', sans-serif;
}
.analytics-table, .analytics-table tbody, .analytics-table tr, .analytics-table td {
    display: block; width: 100%;
}
.analytics-table thead { display: none; } /* labels come from data-label instead */
.analytics-table tr.analytics-row {
    background: rgba(162, 89, 255, .07);
    border: 1px solid rgba(162, 89, 255, .25);
    border-radius: 10px; padding: 6px 4px; margin-bottom: 10px;
}
.analytics-table td { text-align: left; padding: 7px 12px; vertical-align: top; }
.analytics-table td::before {
    content: attr(data-label);
    display: block;
    font-family: 'Orbitron', sans-serif; font-size: 0.6rem; letter-spacing: 1.5px;
    text-transform: uppercase; color: var(--neon-cyan); opacity: .8;
    margin-bottom: 2px;
}
.an-puzzle { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.an-puzzle::before { flex-basis: 100%; }
.an-num { font-family: 'Orbitron', sans-serif; font-size: 0.95rem; }

@media (min-width: 700px) {
    .analytics-table { display: table; }
    .analytics-table thead { display: table-header-group; }
    .analytics-table tbody { display: table-row-group; }
    .analytics-table tr, .analytics-table tr.analytics-row {
        display: table-row;
        background: none; border: none; border-radius: 0; padding: 0; margin: 0;
    }
    .analytics-table td { display: table-cell; width: auto; }
    .analytics-table td::before { display: none; }
    .analytics-table th, .analytics-table td {
        padding: 12px 14px;
        border-bottom: 1px solid rgba(162, 89, 255, .2);
    }
    .analytics-table th {
        font-family: 'Orbitron', sans-serif; font-size: 0.7rem; letter-spacing: 1.5px;
        text-transform: uppercase; color: var(--neon-cyan);
        border-bottom: 1px solid rgba(0, 240, 255, .4);
        text-align: left; vertical-align: bottom;
    }
    .analytics-row:hover { background: rgba(0, 240, 255, .06); }
    .an-col-puzzle { width: 40%; }
    .an-puzzle { display: table-cell; }
    .an-num { text-align: right; white-space: nowrap; }
    .analytics-table th:not(.an-col-puzzle) { text-align: right; }
}

/* ---------- Admin: CTAs tab ---------- */
.cta-form { display: flex; flex-direction: column; gap: 20px; }
.cta-group {
    border: 1px solid rgba(162, 89, 255, .3);
    border-radius: 12px; padding: 6px 14px 16px;
}
.cta-group-etsy    { border-color: rgba(255, 46, 151, .45); }
.cta-group-patreon { border-color: rgba(255, 230, 0, .4); }
.cta-legend {
    font-family: 'Orbitron', sans-serif; font-size: 0.78rem; letter-spacing: 2px;
    color: var(--neon-cyan); padding: 0 8px;
}
.cta-group-etsy .cta-legend    { color: var(--neon-magenta); }
.cta-group-patreon .cta-legend { color: var(--neon-yellow); }
.cta-card { display: flex; flex-direction: column; padding-top: 8px; }
.cta-card + .cta-card {
    margin-top: 14px; padding-top: 14px;
    border-top: 1px solid rgba(162, 89, 255, .2);
}
.cta-card-title {
    font-family: 'Orbitron', sans-serif; font-size: 0.72rem; letter-spacing: 1.6px;
    color: var(--text); text-transform: uppercase;
}
@media (min-width: 861px) {
    .cta-group { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
    .cta-card + .cta-card { margin-top: 0; padding-top: 8px; border-top: none; }
    /* The review request isn't one of the two CTA kinds — give it its own
       full-width row under them rather than a lopsided third column. */
    .cta-card-review {
        grid-column: 1 / -1;
        margin-top: 14px; padding-top: 14px;
        border-top: 1px solid rgba(162, 89, 255, .2);
    }
}

/* ---------- Admin: share (URL + QR) dialog ---------- */
.platform-toggle { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.platform-opt {
    flex: 1 1 90px; min-height: 44px; cursor: pointer;
    font-family: 'Orbitron', sans-serif; font-size: 0.7rem; letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-dim); background: rgba(4, 0, 16, .5);
    border: 1px solid rgba(162, 89, 255, .35); border-radius: 10px;
    padding: 10px 8px;
    transition: color .15s, border-color .15s, background .15s;
}
.platform-opt:hover { color: var(--neon-cyan); border-color: rgba(0, 240, 255, .5); }
.platform-opt.is-active {
    color: #06010f; background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    border-color: transparent; box-shadow: 0 0 14px rgba(0, 240, 255, .35);
}
/* The link readout inside the share dialog only — the row button that opens
   the dialog is .share-open, so it keeps the plain .btn styling. */
.share-url {
    font-family: 'Rajdhani', monospace; font-size: 0.95rem;
    color: var(--neon-cyan); word-break: break-all;
    background: rgba(4, 0, 16, .5);
    border: 1px solid rgba(0, 240, 255, .3); border-radius: 10px;
    padding: 12px 14px; margin-bottom: 16px;
}
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-actions .btn { flex: 1 1 auto; text-align: center; }

.hidden { display: none !important; }
