/* Pinnwand — Cork Board Design */

/* ── Reset & Base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Nunito', system-ui, sans-serif;
    color: #333;
    -webkit-font-smoothing: antialiased;
}

/* ── Landing Mode ── */

.mode-landing {
    background: #855CD6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

.landing-header {
    padding: 1.25rem 2rem;
    text-align: center;
    position: relative;
    z-index: 10;
}

.landing-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    height: 24px;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 800;
    color: rgba(255,255,255,0.9);
    letter-spacing: -0.02em;
}

/* Wavy Scratch background decoration — centered behind code input */
.scratch-bg-wrap {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -40%);
    width: 80%;
    max-width: 900px;
    pointer-events: none;
    z-index: 2;
    opacity: 0.85;
}

.scratch-bg-img {
    width: 100%;
    height: auto;
    display: block;
}

.landing-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    z-index: 10;
    text-align: center;
    animation: slideUp 0.4s ease-out;
}

.landing-cat {
    margin-bottom: 0.75rem;
    opacity: 0.9;
    filter: brightness(0) invert(1);
}

.landing-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
    color: white;
    margin-bottom: 0.4rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.landing-subtitle {
    text-align: center;
    color: rgba(255,255,255,0.75);
    font-size: 1.15rem;
    margin-bottom: 2rem;
    font-weight: 600;
}

.landing-code-section {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}

/* ── Floating Scratch Blocks ── */

.scratch-blocks-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.scratch-block {
    position: absolute;
    opacity: 0.7;
    filter: drop-shadow(0 2px 0 rgba(0,0,0,0.25));
}

/* Block Positions + Float */
.sb-1 { top: 8%; left: 3%; transform: rotate(-6deg); animation: float1 20s ease-in-out infinite; }
.sb-2 { top: 20%; right: 5%; transform: rotate(4deg); animation: float2 24s ease-in-out infinite; }
.sb-3 { top: 42%; left: 2%; transform: rotate(-2deg); animation: float1 22s ease-in-out infinite 3s; }
.sb-4 { top: 62%; right: 4%; transform: rotate(6deg); animation: float2 18s ease-in-out infinite 1s; }
.sb-5 { top: 78%; left: 4%; transform: rotate(-4deg); animation: float1 21s ease-in-out infinite 5s; }
.sb-6 { top: 14%; right: 18%; transform: rotate(3deg); animation: float2 25s ease-in-out infinite 2s; }
.sb-7 { bottom: 12%; right: 3%; transform: rotate(-5deg); animation: float1 19s ease-in-out infinite 4s; }
.sb-8 { top: 36%; right: 2%; transform: rotate(3deg); animation: float2 23s ease-in-out infinite 6s; }

.landing-input {
    padding: 0.75rem 1rem;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: rgba(255,255,255,0.15);
    color: white;
}

.landing-input::placeholder {
    color: rgba(255,255,255,0.4);
}

.landing-input:focus {
    border-color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.2);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.1);
}

.landing-create-link {
    position: fixed;
    bottom: 1.25rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0.25rem 0.5rem;
    z-index: 20;
}

.landing-create-link:hover {
    color: rgba(255,255,255,0.8);
}

.landing-code-input {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 0.35em;
    width: 220px;
    padding: 0.7rem 1rem;
    border-radius: 1rem;
    background: rgba(255,255,255,0.95);
    color: #855CD6;
    border: 3px solid rgba(255,255,255,0.6);
}

.landing-code-input::placeholder {
    color: rgba(133,92,214,0.3);
}

.landing-code-input:focus {
    background: white;
    border-color: white;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.2), 0 8px 25px rgba(0,0,0,0.15);
    animation: none;
}

.landing-code-input:not(:focus) {
    animation: inputPulse 2.5s ease-in-out infinite;
}

/* ── Buttons ── */

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-create {
    background: #FFAB19;
    color: white;
    box-shadow: 0 4px 12px rgba(255,171,25,0.3);
}
.btn-create:hover:not(:disabled) {
    background: #FF8C1A;
    transform: translateY(-1px);
}

.btn-join {
    background: white;
    color: #855CD6;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    padding: 0.8rem 2rem;
    font-size: 1.3rem;
    border-radius: 1rem;
}
.btn-join:hover:not(:disabled) {
    background: #FFAB19;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255,171,25,0.4);
}

.btn-confirm {
    background: #10b981;
    color: white;
}
.btn-confirm:hover:not(:disabled) {
    background: #059669;
}

.btn-cancel {
    background: #f3f4f6;
    color: #666;
}
.btn-cancel:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
}
.btn-danger:hover:not(:disabled) {
    background: #fecaca;
}

/* ── Board Mode ── */

.mode-board {
    background: #C4956A;
    overflow: hidden;
}

.board-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* ── Cork Board ── */

.cork-board {
    width: 100%;
    height: calc(100% - 44px);
    position: relative;
    overflow: hidden;
    /* Cork texture via CSS gradients */
    background:
        repeating-radial-gradient(circle at 17% 32%, rgba(0,0,0,0.03) 0px, transparent 1px),
        repeating-radial-gradient(circle at 65% 71%, rgba(0,0,0,0.02) 0px, transparent 1px),
        repeating-radial-gradient(circle at 42% 55%, rgba(255,255,255,0.03) 0px, transparent 2px),
        linear-gradient(135deg, #C4956A 0%, #B8875E 50%, #C99F73 100%);
    /* Subtle inner shadow for depth */
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.15);
}

/* ── Notes Grid ── */

.notes-grid {
    display: grid;
    justify-content: center;
    align-content: center;
    padding: 20px 12px 12px;
    height: 100%;
}

/* ── Empty State ── */

.board-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255,255,255,0.7);
    text-align: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.board-empty-icon {
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.board-empty-sub {
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* ── Sticky Note ── */

.note {
    border-radius: 4px;
    padding: 0.5rem;
    padding-top: 0.75rem;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow:
        2px 3px 8px rgba(0,0,0,0.2),
        0 1px 2px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: visible;
    user-select: none;
}

.note:hover {
    transform: rotate(0deg) scale(1.04) !important;
    box-shadow:
        4px 6px 16px rgba(0,0,0,0.25),
        0 2px 4px rgba(0,0,0,0.15);
    z-index: 10;
}

.note-overflow {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.3) !important;
    color: #6b4423;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: default;
    border: 2px dashed rgba(107,68,35,0.3);
}

/* ── Pin (Reißzwecke) ── */

.note-pin {
    width: 22px;
    height: 22px;
    background: radial-gradient(circle at 38% 32%, #ff6b6b, #e74c3c, #c0392b); /* default, overridden by inline style */
    border-radius: 50%;
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    box-shadow: 0 3px 6px rgba(0,0,0,0.35);
}

.note-pin::after {
    content: '';
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.55);
    border-radius: 50%;
    position: absolute;
    top: 4px;
    left: 5px;
}

/* ── Thumbnail ── */

.note-thumb-wrap {
    flex: 1;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.4rem;
    min-height: 0;
    background: rgba(0,0,0,0.05);
}

.note-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Note Text ── */

.note-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: #333;
    margin-top: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.note-team {
    font-size: 0.65rem;
    font-weight: 600;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* ── Like Button ── */

.note-like-btn {
    border: none;
    background: rgba(0,0,0,0.06);
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 5px;
    transition: transform 0.15s, background 0.2s;
    font-family: 'Nunito', sans-serif;
    align-self: flex-start;
    margin-top: 2px;
}

.note-like-btn:hover {
    background: rgba(0,0,0,0.12);
}

.note-like-btn:active {
    transform: scale(1.2);
}

.like-icon {
    fill: #999;
    flex-shrink: 0;
    transition: fill 0.2s;
}

.note-like-btn.liked .like-icon {
    fill: #e74c3c;
}

.note-like-btn:hover .like-icon {
    fill: #c0392b;
}

.like-count {
    font-size: 0.6rem;
    font-weight: 800;
    color: #555;
    line-height: 1;
}

/* ── Edit Button ── */

.note-edit-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(0,0,0,0.08);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    color: #555;
}

.note:hover .note-edit-btn {
    opacity: 1;
}

.note-edit-btn:hover {
    background: rgba(0,0,0,0.15);
}

/* ── FAB (Floating Action Button) ── */

.fab {
    position: fixed;
    bottom: 60px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #FFAB19;
    color: white;
    font-size: 1.8rem;
    font-weight: 300;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255,171,25,0.4);
    z-index: 50;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(255,171,25,0.5);
}

/* ── Board Bar ── */

.board-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: rgba(30,20,10,0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 40;
}

.board-bar-code strong {
    color: white;
    font-weight: 800;
    letter-spacing: 0.1em;
}

/* ── Beamer Overlay ── */

.beamer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,5,20,0.95);
    z-index: 100;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.beamer-overlay.open {
    display: flex;
}

.beamer-content {
    color: white;
    animation: slideUp 0.5s ease-out;
}

.beamer-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.beamer-instruction {
    font-size: 1.3rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    margin-bottom: 1.5rem;
}

.beamer-instruction strong {
    color: white;
}

.beamer-code {
    font-size: 8rem;
    font-weight: 900;
    letter-spacing: 0.3em;
    color: #FFAB19;
    text-shadow: 0 0 40px rgba(255,171,25,0.4);
    margin-bottom: 2rem;
    line-height: 1;
}

.beamer-qr {
    margin-bottom: 2.5rem;
}

.beamer-qr-img {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    border: 4px solid white;
}

.btn-beamer-show {
    background: #FFAB19;
    color: white;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 1rem;
    border: none;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(255,171,25,0.4);
}

.btn-beamer-show:hover {
    background: #FF8C1A;
    transform: translateY(-2px);
}

/* ── Modal ── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.open {
    display: flex;
}

.modal-card {
    background: white;
    border-radius: 1.25rem;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease-out;
}

.modal-card-wide {
    max-width: 700px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 0;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1a1a2e;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #e5e7eb;
}

.modal-body {
    padding: 1.25rem 1.5rem;
}

.modal-body-embed {
    padding: 0.75rem 1.5rem 1.25rem;
}

.modal-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #555;
    margin-bottom: 0.4rem;
    margin-top: 0.8rem;
}

.modal-label:first-child {
    margin-top: 0;
}

.modal-optional {
    font-weight: 600;
    color: #aaa;
}

.modal-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 2px solid #e8e8e8;
    border-radius: 0.6rem;
    font-size: 0.95rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s;
}

.modal-input:focus {
    border-color: #4C97FF;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem 1.25rem;
    gap: 0.5rem;
}

.modal-footer-right {
    display: flex;
    gap: 0.5rem;
}

/* ── Scratch Preview (in pin modal) ── */

.scratch-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 0.6rem;
    margin-top: 0.6rem;
    animation: slideUp 0.2s ease-out;
}

.scratch-preview-img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.4rem;
    flex-shrink: 0;
}

.scratch-preview-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #333;
}

.scratch-preview-author {
    font-size: 0.8rem;
    color: #888;
    font-weight: 600;
}

/* ── Scratch Embed (in view modal) ── */

.scratch-embed {
    width: 100%;
    aspect-ratio: 4/3;
    border: none;
    border-radius: 0.6rem;
    background: #f0f0f0;
}

.view-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #888;
    font-weight: 600;
    padding: 0.5rem 0 0;
}

.btn-fullscreen {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: #4C97FF;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.btn-fullscreen:hover {
    background: #3373CC;
    transform: translateY(-1px);
}

/* ── Toast Notifications ── */

.toast {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    z-index: 300;
    opacity: 0;
    transition: all 300ms ease;
    pointer-events: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    font-family: 'Nunito', sans-serif;
}

.toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-info { background: #4C97FF; color: white; }
.toast-success { background: #10b981; color: white; }
.toast-error { background: #f43f5e; color: white; }

/* ── Animations ── */

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes inputPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255,255,255,0.1), 0 4px 15px rgba(0,0,0,0.1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255,255,255,0.0), 0 4px 20px rgba(0,0,0,0.15);
        border-color: rgba(255,255,255,0.5);
    }
}

/* Code input success state */
.landing-code-input.code-success {
    animation: codeSuccess 0.6s ease-out !important;
    background: #4CBF56 !important;
    color: white !important;
    border-color: #4CBF56 !important;
    box-shadow: 0 0 0 6px rgba(76,191,86,0.3), 0 8px 25px rgba(0,0,0,0.15) !important;
}

@keyframes codeSuccess {
    0% { transform: scale(1); }
    30% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* Confetti canvas */
.confetti-canvas {
    position: fixed;
    inset: 0;
    z-index: 500;
    pointer-events: none;
}

@keyframes float1 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-18px); }
}

@keyframes float2 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-14px); }
}

/* ── Gallery Mode ── */

.mode-gallery {
    background: #855CD6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.gallery-main {
    flex: 1;
    position: relative;
    z-index: 10;
    padding: 0 1.5rem 3rem;
    animation: slideUp 0.4s ease-out;
}

.gallery-hero {
    text-align: center;
    padding: 1rem 0 2rem;
}

.gallery-hero-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn-join-link {
    display: inline-block;
    padding: 0.75rem 1.8rem;
    background: white;
    color: #855CD6;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 0.75rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: all 0.2s;
}
.btn-join-link:hover {
    background: #FFAB19;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255,171,25,0.4);
}

.btn-create-gallery {
    padding: 0.75rem 1.8rem;
    background: rgba(255,255,255,0.15);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-create-gallery:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    max-width: 1100px;
    margin: 0 auto;
}

.gallery-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

.gallery-card-thumbs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    aspect-ratio: 16/10;
    gap: 2px;
    background: #f0f0f0;
}

.gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-thumb-empty {
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
}

.gallery-card-info {
    padding: 0.85rem 1rem;
}

.gallery-card-name {
    font-size: 1rem;
    font-weight: 800;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-card-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #999;
    margin-top: 0.25rem;
}

.admin-stealth-link {
    position: fixed;
    bottom: 0.75rem;
    right: 1rem;
    color: rgba(255,255,255,0.15);
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    z-index: 20;
    transition: color 0.3s;
}
.admin-stealth-link:hover {
    color: rgba(255,255,255,0.5);
}

.gallery-empty {
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 3rem 0;
}

/* ── Admin Mode ── */

.mode-admin {
    background: #f0f2f5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.admin-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: #855CD6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: relative;
    z-index: 10;
}

.admin-header .logo-text {
    color: rgba(255,255,255,0.9);
}

.admin-badge {
    background: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.9);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.admin-content {
    flex: 1;
    padding: 2rem;
}

.admin-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.admin-login-card {
    background: white;
    border-radius: 1.25rem;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
    max-width: 380px;
    width: 100%;
    animation: slideUp 0.3s ease-out;
}

.admin-login-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.admin-login-card p {
    color: #888;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.admin-login-form {
    display: flex;
    gap: 0.5rem;
}

.admin-login-form .modal-input {
    flex: 1;
}

.admin-login-error {
    color: #dc2626;
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 0.75rem;
}

.admin-dashboard {
    max-width: 1000px;
    margin: 0 auto;
    animation: slideUp 0.3s ease-out;
}

.admin-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.admin-dashboard-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1a1a2e;
}

.admin-table-wrap {
    background: white;
    border-radius: 1rem;
    overflow: visible;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    font-weight: 700;
    color: #888;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #f0f0f0;
    background: #fafafa;
}

.admin-table th:first-child { border-radius: 1rem 0 0 0; }
.admin-table th:last-child { border-radius: 0 1rem 0 0; }
.admin-table tr:last-child td:first-child { border-radius: 0 0 0 1rem; }
.admin-table tr:last-child td:last-child { border-radius: 0 0 1rem 0; }

.admin-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    color: #333;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: #fafafa;
}

.admin-actions {
    display: flex;
    gap: 0.4rem;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 0.5rem;
}

.btn-toggle-on {
    background: #d1fae5;
    color: #059669;
    border: none;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
}
.btn-toggle-on:hover { background: #a7f3d0; }

.btn-toggle-off {
    background: #f3f4f6;
    color: #999;
    border: none;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
}
.btn-toggle-off:hover { background: #e5e7eb; }

.btn-toggle-locked {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
}
.btn-toggle-locked:hover { background: #fecaca; }

.btn-toggle-unlocked {
    background: #d1fae5;
    color: #059669;
    border: none;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
}
.btn-toggle-unlocked:hover { background: #a7f3d0; }

.btn-open {
    background: #e0e7ff;
    color: #4338ca;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.btn-open:hover { background: #c7d2fe; }

/* ── Table Header Hints ── */

.th-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #ddd;
    color: #777;
    font-size: 0.6rem;
    font-weight: 800;
    cursor: help;
    position: relative;
    vertical-align: middle;
    margin-left: 2px;
}

.th-hint:hover {
    background: #855CD6;
    color: white;
}

.th-hint:hover::after {
    content: attr(data-hint);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    pointer-events: none;
    text-transform: none;
    letter-spacing: 0;
}

.th-hint:hover::before {
    content: '';
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-bottom-color: #1a1a2e;
    z-index: 100;
}

.admin-empty {
    text-align: center;
    color: #999;
    font-weight: 600;
    padding: 3rem 0;
}

/* ── Responsive ── */

@media (max-width: 480px) {
    .scratch-blocks-bg {
        display: none;
    }

    .scratch-bg-wrap {
        width: 120%;
        opacity: 0.6;
    }

    .landing-title {
        font-size: 1.8rem;
    }

    .landing-subtitle {
        font-size: 1rem;
    }

    .landing-code-input {
        font-size: 2rem;
        width: 180px;
    }

    .beamer-code {
        font-size: 4rem;
    }

    .beamer-title {
        font-size: 1.8rem;
    }

    .beamer-instruction {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .fab {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
        bottom: 54px;
        right: 12px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-hero-buttons {
        flex-direction: column;
    }

    .admin-content {
        padding: 1rem;
    }

    .admin-table {
        font-size: 0.8rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.5rem 0.5rem;
    }

    .admin-actions {
        flex-direction: column;
    }
}
