@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@700;800;900&display=swap');

:root {
    --bg:     #1a0533;
    --purple: #46178f;
    --yellow: #ffd400;
    --red:    #e21b3c;
    --blue:   #1368ce;
    --orange: #d89e00;
    --green:  #26890c;
}

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

body {
    font-family: 'Nunito', 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #1a0533 0%, #2d0f5d 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

/* ─── Screen shell ─────────────────────────────────────── */
.screen { display: none; min-height: 100vh; }
.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
/* game screen overrides centering — must come after .screen.active */
#s-game.active {
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
}
.hidden { display: none !important; }

/* ─── Floating admin button ────────────────────────────── */
.admin-btn {
    position: fixed; top: 16px; right: 16px; z-index: 999;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff; padding: 10px 18px; border-radius: 99px;
    text-decoration: none; font-weight: 800; font-size: 0.82rem;
    transition: background .2s;
}
.admin-btn:hover { background: rgba(255,255,255,0.22); }

/* ─── REGISTER SCREEN ──────────────────────────────────── */
.register-layout {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    width: 100%;
    max-width: 960px;
    animation: fadeUp .5s ease;
}

/* ─── Guide panel ──────────────────────────────────────── */
.guide-panel {
    flex: 1;
    min-width: 0;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 28px;
    padding: 36px 30px;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.guide-title {
    font-size: 1.15rem; font-weight: 900;
    letter-spacing: .04em; color: var(--yellow);
    text-transform: uppercase;
}

.guide-steps { list-style: none; display: flex; flex-direction: column; gap: 18px; }
.guide-step  { display: flex; align-items: flex-start; gap: 14px; }
.gs-num {
    flex-shrink: 0;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--yellow); color: #1a0533;
    font-size: .82rem; font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    margin-top: 1px;
}
.gs-body { display: flex; flex-direction: column; gap: 3px; }
.gs-head { font-size: .9rem; font-weight: 900; color: #fff; }
.gs-desc { font-size: .78rem; color: rgba(255,255,255,.55); line-height: 1.55; }
.gs-desc strong { color: rgba(255,255,255,.85); }

.guide-rules {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 18px;
    margin-top: auto;
}
.guide-rules-title {
    font-size: .72rem; font-weight: 900;
    text-transform: uppercase; letter-spacing: .1em;
    color: rgba(255,212,0,.7); margin-bottom: 10px;
}
.guide-rules ul {
    list-style: none; display: flex; flex-direction: column; gap: 7px;
}
.guide-rules ul li {
    font-size: .76rem; font-weight: 700;
    color: rgba(255,255,255,.45);
    padding-left: 14px; position: relative;
}
.guide-rules ul li::before {
    content: '•'; position: absolute; left: 0;
    color: rgba(255,212,0,.5);
}

.register-wrap {
    width: 100%; max-width: 460px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.07);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 28px;
    padding: 44px 36px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5);
}
@keyframes fadeUp {
    from { opacity:0; transform:translateY(24px); }
    to   { opacity:1; transform:translateY(0); }
}
.brand { text-align: center; margin-bottom: 32px; }
.brand-icon { font-size: 4rem; display: block; animation: float 3s ease-in-out infinite; }
@keyframes float {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-10px); }
}
.brand h1 { font-size: 2.1rem; font-weight: 900; margin-top: 10px; letter-spacing: -.02em; }
.brand p  { color: rgba(255,255,255,.65); font-size: .9rem; margin-top: 6px; }

.field { margin-bottom: 18px; }
.field label {
    display: block; font-size: .78rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .08em;
    color: rgba(255,255,255,.75); margin-bottom: 7px;
}
.field input {
    width: 100%; padding: 15px 18px;
    background: rgba(255,255,255,.12);
    border: 2px solid rgba(255,255,255,.18);
    border-radius: 14px; color: #fff;
    font-size: 1rem; font-weight: 700;
    outline: none;
    transition: border-color .2s, background .2s;
    font-family: inherit;
}
.field input::placeholder { color: rgba(255,255,255,.35); }
.field input:focus {
    border-color: var(--yellow);
    background: rgba(255,255,255,.18);
}

.err-box {
    background: rgba(226,27,60,.15);
    border: 1px solid rgba(226,27,60,.5);
    border-radius: 12px; padding: 12px 16px;
    color: #ff8fa3; font-weight: 700; font-size: .88rem;
    margin-bottom: 16px;
}

.btn-join {
    width: 100%; padding: 18px;
    background: var(--yellow); color: #1a0533;
    border: none; border-radius: 14px; cursor: pointer;
    font-size: 1.25rem; font-weight: 900;
    letter-spacing: .08em; text-transform: uppercase;
    box-shadow: 0 6px 24px rgba(255,212,0,.35);
    transition: transform .15s, box-shadow .15s;
    margin-top: 6px; font-family: inherit;
}
.btn-join:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(255,212,0,.5); }
.btn-join:active { transform: translateY(0); }
.btn-join:disabled { opacity: .7; cursor: not-allowed; transform: none; }

/* ─── DIFFICULTY SCREEN ────────────────────────────────── */
#s-diff { gap: 28px; }

.diff-hdr { text-align: center; }
.diff-hdr .player-tag {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.12); border-radius: 99px;
    padding: 8px 20px; font-weight: 800; font-size: .92rem; margin-bottom: 16px;
}
.diff-hdr h2  { font-size: 2.4rem; font-weight: 900; }
.diff-hdr p   { color: rgba(255,255,255,.65); margin-top: 8px; }

.diff-cards {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 14px; max-width: 560px; width: 100%;
}
.diff-card {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 28px 16px; border-radius: 22px;
    border: 3px solid transparent; cursor: pointer;
    font-weight: 900; color: #fff;
    transition: transform .15s, box-shadow .15s, border-color .15s;
    font-family: inherit;
}
.diff-card.easy   { background: var(--green);  box-shadow: 0 6px 24px rgba(38,137,12,.35); }
.diff-card.medium { background: var(--blue);   box-shadow: 0 6px 24px rgba(19,104,206,.35); }
.diff-card.hard   { background: var(--orange); box-shadow: 0 6px 24px rgba(216,158,0,.35); }
.diff-card.vhard  { background: var(--red);    box-shadow: 0 6px 24px rgba(226,27,60,.35); }
.diff-card:hover  { transform: translateY(-5px) scale(1.03); }
.diff-card.picked {
    border-color: #fff;
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 0 0 4px rgba(255,255,255,.35), 0 12px 36px rgba(0,0,0,.4);
}
.dc-emoji { font-size: 2.8rem; }
.dc-name  { font-size: 1.2rem; font-weight: 900; margin-top: 8px; text-shadow: 0 2px 6px rgba(0,0,0,.3); }
.dc-grid  { font-size: .78rem; opacity: .8; margin-top: 4px; }

.btn-go {
    background: var(--yellow); color: #1a0533;
    border: none; border-radius: 14px; cursor: pointer;
    font-size: 1.3rem; font-weight: 900;
    letter-spacing: .08em; text-transform: uppercase;
    padding: 18px 64px;
    box-shadow: 0 6px 24px rgba(255,212,0,.35);
    transition: transform .15s, box-shadow .15s;
    font-family: inherit;
}
.btn-go:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(255,212,0,.5); }

/* ─── COUNTDOWN SCREEN ─────────────────────────────────── */
#s-count { background: var(--purple); }
.count-wrap { text-align: center; }
.count-label {
    font-size: 1.5rem; font-weight: 800; color: rgba(255,255,255,.7);
    text-transform: uppercase; letter-spacing: .12em; margin-bottom: 16px;
}
.count-num {
    font-size: 13rem; font-weight: 900; line-height: 1;
    color: var(--yellow); text-shadow: 0 0 80px rgba(255,212,0,.6);
}
.count-num.anim { animation: countZoom .85s ease forwards; }
@keyframes countZoom {
    0%   { transform: scale(2.2); opacity: 0; }
    20%  { transform: scale(1);   opacity: 1; }
    80%  { transform: scale(1);   opacity: 1; }
    100% { transform: scale(.6);  opacity: 0; }
}

/* ─── GAME SCREEN ──────────────────────────────────────── */

.topbar {
    width: 100%; background: var(--purple);
    display: flex; align-items: center;
    justify-content: space-between; gap: 12px;
    padding: 12px 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
    flex-shrink: 0;
}
.tb-player { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.tb-name { font-size: 1rem; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-diff {
    font-size: .68rem; background: rgba(255,255,255,.18);
    border-radius: 99px; padding: 2px 10px; font-weight: 800;
    display: inline-block; width: fit-content;
}
.tb-center, .tb-right { text-align: center; }
.tb-stat-label {
    font-size: .62rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .12em; color: rgba(255,255,255,.5);
}
.tb-stat-val { font-size: 2.4rem; font-weight: 900; color: var(--yellow); line-height: 1.1; }

.game-area {
    display: flex; gap: 24px; padding: 24px;
    justify-content: center; align-items: flex-start;
    flex-wrap: wrap; width: 100%; flex: 1;
}
.puzzle-col { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.puzzle-caption {
    font-size: .76rem; font-weight: 800; color: rgba(255,255,255,.45);
    text-transform: uppercase; letter-spacing: .06em;
}

#sortable {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-wrap: wrap; align-content: flex-start;
    border-radius: 20px; overflow: hidden;
    border: 3px solid rgba(255,255,255,.18);
    box-shadow: 0 12px 48px rgba(0,0,0,.5);
    background: rgba(0,0,0,.3);
}
#sortable li {
    cursor: grab;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,.15);
    transition: opacity .1s, transform .1s;
    touch-action: none;
}
#sortable li:hover { transform: scale(1.04); z-index: 5; position: relative; }
#sortable li:active { cursor: grabbing; opacity: .85; }
#sortable li.ui-draggable-dragging { z-index: 100; opacity: .9; }

.side-col { display: flex; flex-direction: column; gap: 16px; width: 280px; }

.img-reveal {
    border-radius: 20px; overflow: hidden;
    background: rgba(255,255,255,.06);
    border: 2px solid rgba(255,255,255,.12);
    min-height: 260px;
    display: flex; align-items: center; justify-content: center;
}
.img-placeholder {
    text-align: center; padding: 28px;
    color: rgba(255,255,255,.45); font-weight: 800; font-size: .9rem; line-height: 1.7;
}
.img-reveal img {
    width: 100%; height: auto; display: block;
    animation: fadeIn .6s ease;
}
@keyframes fadeIn {
    from { opacity:0; transform:scale(.95); }
    to   { opacity:1; transform:scale(1); }
}

.btn-cancel {
    width: 100%; padding: 14px;
    background: rgba(226,27,60,.12);
    border: 2px solid rgba(226,27,60,.4);
    border-radius: 14px; color: #ff8fa3;
    font-size: .92rem; font-weight: 800; cursor: pointer;
    transition: background .2s, border-color .2s;
    letter-spacing: .04em; font-family: inherit;
}
.btn-cancel:hover { background: rgba(226,27,60,.28); border-color: var(--red); }
.btn-cancel:disabled { opacity: .35; cursor: not-allowed; }

/* ─── CANCEL MODAL ─────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; z-index: 999;
    background: rgba(10, 0, 25, 0.75);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: fadeOverlay .2s ease;
}
@keyframes fadeOverlay {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.modal-overlay.hidden { display: none; }

.modal-box {
    background: #2d1060;
    border: 2px solid rgba(255,255,255,.18);
    border-radius: 28px;
    padding: 40px 36px;
    max-width: 400px; width: 100%;
    text-align: center;
    box-shadow: 0 32px 80px rgba(0,0,0,.7);
    animation: modalPop .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalPop {
    from { transform: scale(.7); opacity: 0; }
    to   { transform: scale(1);  opacity: 1; }
}
.modal-icon  { font-size: 3.5rem; display: block; margin-bottom: 12px; }
.modal-title { font-size: 1.6rem; font-weight: 900; margin-bottom: 10px; }
.modal-desc  { color: rgba(255,255,255,.65); font-size: .95rem; margin-bottom: 28px; line-height: 1.5; }

.modal-actions { display: flex; gap: 12px; }
.modal-btn {
    flex: 1; padding: 16px 10px;
    border: none; border-radius: 14px; cursor: pointer;
    font-size: 1rem; font-weight: 900; font-family: inherit;
    letter-spacing: .04em; transition: transform .15s, box-shadow .15s;
}
.modal-btn.keep {
    background: var(--yellow); color: #1a0533;
    box-shadow: 0 4px 16px rgba(255,212,0,.35);
}
.modal-btn.keep:hover  { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,212,0,.5); }
.modal-btn.quit {
    background: rgba(226,27,60,.2);
    border: 2px solid rgba(226,27,60,.5);
    color: #ff8fa3;
}
.modal-btn.quit:hover  { background: rgba(226,27,60,.38); transform: translateY(-2px); }

/* ─── RESULT SCREEN ────────────────────────────────────── */
.result-wrap {
    text-align: center; max-width: 460px; width: 100%;
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255,255,255,.15);
    border-radius: 28px; padding: 50px 36px;
    box-shadow: 0 32px 80px rgba(0,0,0,.5);
    animation: fadeUp .5s ease;
}
.result-icon { font-size: 5.5rem; display: block; animation: tada .7s ease; }
@keyframes tada {
    0%   { transform: scale(.2) rotate(-15deg); opacity:0; }
    40%  { transform: scale(1.15) rotate(5deg); opacity:1; }
    60%  { transform: scale(.95) rotate(-3deg); }
    80%  { transform: scale(1.05) rotate(2deg); }
    100% { transform: scale(1) rotate(0); }
}
.result-title { font-size: 2.1rem; font-weight: 900; margin: 16px 0 24px; }
.result-stats  { display: flex; gap: 16px; justify-content: center; margin-bottom: 24px; }
.stat-box {
    background: rgba(255,255,255,.1);
    border-radius: 18px; padding: 20px 28px; min-width: 110px;
}
.stat-val { font-size: 2.8rem; font-weight: 900; color: var(--yellow); }
.stat-lbl {
    font-size: .7rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .1em;
    color: rgba(255,255,255,.5); margin-top: 4px;
}
.result-msg { color: rgba(255,255,255,.65); margin-bottom: 28px; font-size: .95rem; }
.btn-again {
    background: var(--yellow); color: #1a0533;
    border: none; border-radius: 12px; cursor: pointer;
    font-size: 1.1rem; font-weight: 900; padding: 16px 44px;
    letter-spacing: .08em; text-transform: uppercase;
    transition: transform .15s; font-family: inherit;
}
.btn-again:hover { transform: translateY(-3px); }

/* ─── ADMIN STYLES ─────────────────────────────────────── */
.admin-login-screen {
    min-height: 100vh; display: flex;
    align-items: center; justify-content: center; padding: 16px;
}
.admin-login-card {
    max-width: 380px; width: 100%;
    background: rgba(255,255,255,.08); backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 20px; padding: 32px 28px;
    text-align: center; animation: fadeUp .5s ease;
}
.admin-login-card .brand-icon { font-size: 2.8rem; display: block; margin-bottom: 8px; }
.admin-login-card h1 { font-size: 1.5rem; font-weight: 900; }
.admin-login-card .subtitle { color: rgba(255,255,255,.55); margin: 6px 0 20px; font-size: .82rem; }
.admin-login-card .field { margin-bottom: 12px; }
.admin-login-card .field label { text-align: left; }
.btn-login {
    width: 100%; padding: 13px;
    background: var(--yellow); color: #1a0533;
    border: none; border-radius: 10px;
    font-size: 1rem; font-weight: 900; cursor: pointer;
    text-transform: uppercase; letter-spacing: .08em;
    transition: transform .15s; font-family: inherit;
}
.btn-login:hover { transform: translateY(-2px); }
.back-link {
    display: inline-block; margin-top: 14px;
    color: rgba(255,255,255,.45); font-size: .82rem; text-decoration: none;
}
.back-link:hover { color: #fff; }

.admin-wrap { max-width: 1600px; margin: 0 auto; padding: 14px 20px; }

/* ── Topbar ── */
.admin-topbar {
    display: flex; align-items: center;
    justify-content: space-between; flex-wrap: wrap; gap: 8px;
    padding: 10px 16px; background: var(--purple);
    border-radius: 12px; margin-bottom: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.admin-topbar-left h1 { font-size: 1.1rem; font-weight: 900; display: flex; align-items: center; gap: 6px; }
.admin-topbar-left p  { color: rgba(255,255,255,.55); font-size: .72rem; margin-top: 1px; }
.admin-topbar-right   { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-outline {
    padding: 7px 14px;
    border: 1.5px solid rgba(255,255,255,.3); border-radius: 99px;
    color: #fff; background: transparent; font-weight: 800;
    text-decoration: none; font-size: .78rem; cursor: pointer;
    transition: background .2s; font-family: inherit;
}
.btn-outline:hover { background: rgba(255,255,255,.1); }
.btn-danger-outline {
    padding: 7px 14px;
    border: 1.5px solid rgba(226,27,60,.4); border-radius: 99px;
    color: #ff8fa3; background: rgba(226,27,60,.1); font-weight: 800;
    text-decoration: none; font-size: .78rem; cursor: pointer;
    transition: background .2s; font-family: inherit;
}
.btn-danger-outline:hover { background: rgba(226,27,60,.25); }

/* ── Alert ── */
.alert {
    padding: 10px 14px; border-radius: 10px;
    font-weight: 700; font-size: .82rem; margin-bottom: 14px;
    display: flex; align-items: center; gap: 8px;
}
.alert.success { background: rgba(38,137,12,.18); border: 1px solid rgba(38,137,12,.4); color: #7ee67e; }
.alert.error   { background: rgba(226,27,60,.18); border: 1px solid rgba(226,27,60,.4); color: #ff8fa3; }

/* ── Grid & Cards ── */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.admin-card {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 14px; padding: 14px 16px;
}
.admin-card.full { grid-column: 1 / -1; }
.admin-card-title {
    font-size: .88rem; font-weight: 900;
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 2px; color: rgba(255,255,255,.95);
}
.admin-card-desc {
    color: rgba(255,255,255,.4); font-size: .72rem; margin-bottom: 12px;
    line-height: 1.4;
}

/* ── Difficulty radios ── */
.diff-radio-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px;
}
.diff-radio-lbl {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 10px;
    cursor: pointer; border: 1.5px solid transparent;
    transition: border-color .15s, background .15s; text-align: left;
}
.diff-radio-lbl.easy   { background: rgba(38,137,12,.2); }
.diff-radio-lbl.medium { background: rgba(19,104,206,.2); }
.diff-radio-lbl.hard   { background: rgba(216,158,0,.2); }
.diff-radio-lbl.vhard  { background: rgba(226,27,60,.2); }
.diff-radio-lbl input  { display: none; }
.diff-radio-lbl.checked { border-color: #fff; background-color: rgba(255,255,255,.08); }
.diff-radio-lbl .dr-emoji { font-size: 1.3rem; flex-shrink: 0; }
.diff-radio-lbl .dr-name  { font-size: .8rem; font-weight: 900; display: block; }
.diff-radio-lbl .dr-grid  { font-size: .66rem; color: rgba(255,255,255,.55); display: block; }

/* ── Buttons ── */
.btn-primary {
    width: 100%; padding: 11px;
    background: var(--yellow); color: #1a0533;
    border: none; border-radius: 10px; cursor: pointer;
    font-size: .82rem; font-weight: 900;
    text-transform: uppercase; letter-spacing: .06em;
    transition: transform .15s; font-family: inherit;
}
.btn-primary:hover { transform: translateY(-1px); }

.btn-danger {
    width: 100%; padding: 11px;
    background: rgba(226,27,60,.18);
    border: 1.5px solid rgba(226,27,60,.5);
    border-radius: 10px; color: #ff8fa3; cursor: pointer;
    font-size: .82rem; font-weight: 900;
    transition: background .2s; font-family: inherit;
}
.btn-danger:hover { background: rgba(226,27,60,.32); }

/* ── Admin table ── */
.tbl-wrap { overflow-x: auto; }
.adm-tbl { width: 100%; border-collapse: collapse; font-size: .78rem; min-width: 520px; }
.adm-tbl th {
    text-align: left; padding: 7px 10px;
    font-size: .62rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .1em;
    color: rgba(255,255,255,.38);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.adm-tbl td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,.05);
    color: rgba(255,255,255,.82);
}
.adm-tbl tr:last-child td { border-bottom: none; }
.adm-tbl tbody tr:hover td { background: rgba(255,255,255,.03); }

.rank-badge { font-size: 1.2rem; }
.rank-2 .rank-badge, .rank-3 .rank-badge { font-size: 1rem; }
.time-val { font-size: .9rem; font-weight: 900; color: var(--yellow); }
.badge-done   { background: rgba(38,137,12,.22); color: #7ee67e; border-radius: 99px; padding: 3px 9px; font-size: .66rem; font-weight: 800; white-space: nowrap; }
.badge-cancel { background: rgba(226,27,60,.18); color: #ff8fa3; border-radius: 99px; padding: 3px 9px; font-size: .66rem; font-weight: 800; white-space: nowrap; }
.emp-code { font-family: monospace; font-size: .82rem; color: rgba(255,255,255,.65); }

.btn-del {
    padding: 4px 11px; border-radius: 99px;
    background: rgba(226,27,60,.12);
    border: 1px solid rgba(226,27,60,.35);
    color: #ff8fa3; font-size: .7rem; font-weight: 800;
    cursor: pointer; transition: background .2s; font-family: inherit;
    white-space: nowrap;
}
.btn-del:hover { background: rgba(226,27,60,.3); }

.empty-state {
    text-align: center; padding: 28px 16px;
    color: rgba(255,255,255,.25); font-weight: 700; font-size: .82rem;
}

/* ─── PHOTO GRID (admin) ───────────────────────────────── */
.count-pill {
    background: rgba(255,255,255,.1); border-radius: 99px;
    padding: 1px 10px; font-size: .68rem; font-weight: 700; margin-left: 6px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px; margin-bottom: 16px;
}
.photo-card {
    border-radius: 10px; overflow: hidden;
    background: rgba(255,255,255,.05);
    border: 2px solid rgba(255,255,255,.08);
    transition: border-color .2s, transform .15s;
}
.photo-card.is-active { border-color: var(--yellow); }
.photo-card:hover { transform: translateY(-2px); }

.photo-thumb { position: relative; overflow: hidden; height: 80px; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.photo-card:hover .photo-thumb img { transform: scale(1.07); }

.photo-check {
    position: absolute; top: 5px; right: 5px;
    background: var(--yellow); color: #1a0533;
    border-radius: 99px; width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: .65rem; font-weight: 900;
    opacity: 0; transition: opacity .2s;
}
.photo-card.is-active .photo-check { opacity: 1; }

.photo-meta { padding: 7px 8px 8px; }
.photo-title {
    font-size: .68rem; font-weight: 700; color: rgba(255,255,255,.75);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px;
}
.photo-btns { display: flex; align-items: center; justify-content: space-between; gap: 4px; }

.btn-toggle {
    border: none; border-radius: 99px;
    padding: 3px 8px; font-size: .62rem; font-weight: 800;
    cursor: pointer; font-family: inherit; transition: background .15s;
}
.btn-toggle.on  { background: rgba(255,212,0,.18); color: var(--yellow); }
.btn-toggle.off { background: rgba(255,255,255,.07); color: rgba(255,255,255,.35); }
.btn-toggle:hover { filter: brightness(1.25); }

.btn-photo-del {
    background: none; border: none; cursor: pointer;
    font-size: .85rem; opacity: .3; transition: opacity .15s; padding: 2px 3px;
}
.btn-photo-del:hover { opacity: 1; }

/* compact inputs inside admin cards */
.admin-card .field { margin-bottom: 10px; }
.admin-card .field label { font-size: .7rem; margin-bottom: 5px; }
.admin-card .field input {
    padding: 9px 12px; font-size: .82rem;
    border-radius: 10px; border: 1px solid rgba(255,255,255,.15);
}

/* ── Upload section ── */
.upload-section {
    border-top: 1px solid rgba(255,255,255,.07);
    padding-top: 14px; margin-top: 2px;
}
.upload-title { font-size: .76rem; font-weight: 800; margin-bottom: 10px; color: rgba(255,255,255,.55); }
.upload-form .upload-fields { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.upload-btn-wrap { flex-shrink: 0; }
.upload-form .field { margin-bottom: 0; }
.upload-form .field label { margin-bottom: 5px; }

.file-input {
    width: 100%; padding: 9px 12px;
    background: rgba(255,255,255,.06);
    border: 1.5px dashed rgba(255,255,255,.18);
    border-radius: 10px; color: rgba(255,255,255,.65);
    font-size: .78rem; font-family: inherit; cursor: pointer;
    transition: border-color .2s, background .2s;
}
.file-input:hover { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.1); }
.file-input::file-selector-button {
    background: rgba(255,255,255,.12); border: none;
    color: #fff; padding: 4px 10px; border-radius: 6px;
    font-weight: 700; font-size: .75rem; cursor: pointer; margin-right: 8px;
    transition: background .15s;
}
.file-input::file-selector-button:hover { background: rgba(255,255,255,.22); }

/* ─── Photo visibility preview (admin) ────────────────── */
.photo-visibility-preview { margin: 10px 0 12px; }
.pv-state {
    padding: 8px 12px; border-radius: 8px;
    font-size: .78rem; font-weight: 800;
}
.pv-hidden  { background: rgba(226,27,60,.12);  color: #ff8fa3; border: 1px solid rgba(226,27,60,.25); }
.pv-visible { background: rgba(38,137,12,.12);  color: #7ee67e; border: 1px solid rgba(38,137,12,.25); }

/* ─── Locked difficulty (player side) ─────────────────── */
.diff-lock-notice {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 99px; padding: 7px 18px;
    font-size: .82rem; font-weight: 800;
    color: rgba(255,255,255,.65); margin-top: 8px;
}
.diff-card:disabled {
    opacity: 0.28;
    cursor: not-allowed;
    filter: grayscale(50%);
    transform: none !important;
    box-shadow: none !important;
}

/* ─── Admin lock toggle ────────────────────────────────── */
.lock-toggle-lbl {
    display: flex; align-items: center; gap: 10px;
    cursor: pointer; margin-bottom: 12px; margin-top: 4px;
    padding: 10px 12px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    transition: background .2s;
}
.lock-toggle-lbl:hover { background: rgba(255,255,255,.09); }
.lock-toggle-lbl input[type=checkbox] { display: none; }
.lock-toggle-track {
    width: 36px; height: 20px; border-radius: 99px;
    background: rgba(255,255,255,.15);
    position: relative; flex-shrink: 0;
    transition: background .2s;
}
.lock-toggle-track::after {
    content: ''; position: absolute;
    top: 3px; left: 3px;
    width: 14px; height: 14px; border-radius: 50%;
    background: rgba(255,255,255,.45);
    transition: transform .2s, background .2s;
}
.lock-toggle-lbl:has(input:checked) .lock-toggle-track { background: var(--yellow); }
.lock-toggle-lbl:has(input:checked) .lock-toggle-track::after {
    transform: translateX(16px); background: #1a0533;
}
.lock-toggle-text { font-size: .78rem; font-weight: 800; color: rgba(255,255,255,.75); }

/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 860px) {
    .admin-grid { grid-template-columns: 1fr; }
    .admin-card.full { grid-column: 1; }
}
@media (max-width: 860px) {
    .register-layout { flex-direction: column; align-items: center; }
    .guide-panel { width: 100%; max-width: 460px; align-self: auto; }
}
@media (max-width: 768px) {
    .diff-cards { gap: 10px; }
    .game-area { flex-direction: column; align-items: center; padding: 12px; }
    .side-col { width: 100%; max-width: 420px; }
    .count-num { font-size: 9rem; }
    .topbar { padding: 10px 14px; }
    .tb-stat-val { font-size: 1.9rem; }
}
@media (max-width: 480px) {
    .register-wrap { padding: 28px 20px; }
    .diff-card { padding: 20px 12px; }
    .dc-emoji { font-size: 2.2rem; }
    .result-stats { gap: 10px; }
    .stat-box { padding: 14px 18px; }
    .count-num { font-size: 7rem; }
    .admin-login-card { padding: 32px 20px; }
}
