/* --- Reset & base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    overscroll-behavior: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a24;
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#app {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    text-align: center;
}

#app.game-active {
    max-width: min(1440px, 100vw);
    padding: 18px clamp(16px, 3vw, 36px) 28px;
}

#game-screen {
    width: 100%;
}

#game-content {
    width: 100%;
    max-width: none;
    margin: 0 auto;
}

/* --- Typography --- */
h1 {
    font-size: 1.8em;
    color: #ffcc33;
    margin-bottom: 30px;
}

h2 {
    font-size: 1.4em;
    margin-bottom: 15px;
}

/* --- Form --- */
#join-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input {
    padding: 15px;
    font-size: 1.2em;
    border: 2px solid #333;
    border-radius: 8px;
    background: #2a2a3a;
    color: #fff;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: #ffcc33;
}

#room-code {
    font-size: 1.8em;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    font-family: monospace;
}

/* --- Button --- */
button {
    padding: 15px;
    font-size: 1.2em;
    border: none;
    border-radius: 8px;
    background: #3a8a3a;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: #4a9a4a;
}

button:active {
    background: #2a7a2a;
}

button:disabled {
    background: #555;
    cursor: not-allowed;
}

/* --- Error --- */
.error {
    color: #ff6666;
    font-size: 0.9em;
    min-height: 1.2em;
}

/* --- Utility --- */
.hidden {
    display: none !important;
}

/* --- Lobby --- */
#lobby-screen p {
    margin: 8px 0;
    color: #ccc;
}

#lobby-room-code,
#lobby-player-name {
    color: #ffcc33;
    font-weight: bold;
}

#player-list {
    margin-top: 20px;
    text-align: left;
}

#player-list h3 {
    font-size: 1em;
    color: #aaa;
    margin-bottom: 8px;
}

.player-item {
    padding: 8px 12px;
    background: #2a2a3a;
    border-radius: 6px;
    margin-bottom: 6px;
}

/* --- Game screens --- */
.question-header {
    color: #888;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.question-text {
    margin-bottom: 20px;
    line-height: 1.3;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.option-btn {
    padding: 14px 16px;
    font-size: 1.1em;
    border: 2px solid #444;
    border-radius: 8px;
    background: #2a2a3a;
    color: #fff;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
}

.option-btn:hover:not(:disabled) {
    background: #3a4a5a;
    border-color: #ffcc33;
}

.option-btn:disabled {
    cursor: default;
    opacity: 0.7;
}

.option-selected {
    background: #3a6a3a !important;
    border-color: #5a5 !important;
}

/* --- Timer bar --- */
.timer-bar {
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}

.timer-fill {
    width: 100%;
    height: 100%;
    background: #ffcc33;
    animation: timer-shrink linear forwards;
    transform-origin: left;
}

@keyframes timer-shrink {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* --- Guess input --- */
.guess-input {
    margin-bottom: 20px;
}

#guess-slider {
    width: 100%;
    margin: 10px 0;
    accent-color: #ffcc33;
}

.guess-labels {
    display: flex;
    justify-content: space-between;
    color: #aaa;
    font-size: 0.9em;
}

.guess-labels #guess-value {
    font-size: 1.6em;
    color: #ffcc33;
    font-weight: bold;
}

.guess-unit {
    color: #888;
    font-size: 0.85em;
    margin-top: 4px;
}

.submit-guess-btn {
    margin-top: 15px;
    width: 100%;
    padding: 14px;
    font-size: 1.1em;
    background: #3a6a3a;
}

.submit-guess-btn:hover:not(:disabled) {
    background: #4a7a4a;
}

.fb-reject-notice {
    background: #553322;
    color: #ffcc33;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
    animation: pulse 0.5s ease-in-out;
}

/* --- Time up --- */
.time-up-banner {
    background: #cc3333;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 15px;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* --- Result screen --- */
.result-screen {
    text-align: center;
}

.correct-answer {
    font-size: 1.6em;
    color: #5c5;
    margin: 15px 0;
    font-weight: bold;
}

.no-answer {
    color: #888;
    font-style: italic;
}

.points-earned {
    font-size: 1.4em;
    color: #ffcc33;
    margin: 10px 0;
    font-weight: bold;
}

.total-score {
    color: #aaa;
    margin-top: 10px;
}

/* --- Color comparison swatches --- */
.color-compare {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 15px 0;
}

.color-compare-swatches {
    display: flex;
}

.color-compare-swatch {
    width: 110px;
    height: 110px;
}

.color-compare-left {
    border-radius: 10px 0 0 10px;
}

.color-compare-right {
    border-radius: 0 10px 10px 0;
}

.color-compare-none {
    background: repeating-linear-gradient(45deg, #333, #333 8px, #444 8px, #444 16px) !important;
}

.color-compare-labels {
    display: flex;
    width: 220px;
    justify-content: space-around;
    margin-top: 6px;
    font-size: 0.85em;
    color: #aaa;
}

/* --- Waveform comparison --- */
.waveform-compare {
    margin: 15px auto;
    text-align: center;
}

.waveform-compare canvas {
    border-radius: 8px;
    border: 1px solid #333;
    max-width: 100%;
}

.waveform-legend {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 6px;
    font-size: 0.85em;
}

.waveform-label-correct {
    color: #5c5;
}

.waveform-label-yours {
    color: #f5a623;
}

.distance-display {
    font-size: 1.2em;
    color: #7af;
    margin: 8px 0;
    font-weight: bold;
}

/* --- Scoreboard --- */
.scoreboard h2 {
    color: #ffcc33;
    margin-bottom: 15px;
}

.score-entry {
    padding: 10px 14px;
    background: #2a2a3a;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 1.1em;
}

.score-entry-me {
    background: #2a3a5a;
    border: 1px solid #4a6a9a;
}

.admin-lobby-btn {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 14px;
    font-size: 1.1em;
    font-weight: bold;
    color: #fff;
    background: #2a7a3a;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.admin-lobby-btn:active {
    background: #3a9a4a;
}

.reaction-times-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #333;
}

.reaction-times-section h3 {
    color: #ffcc33;
    font-size: 0.95em;
    margin-bottom: 8px;
}

.rt-entry {
    padding: 4px 0;
    font-size: 0.9em;
    color: #ccc;
}

/* --- Game over --- */
.game-over {
    text-align: center;
    padding: 40px 0;
}

.game-over h2 {
    font-size: 1.8em;
    color: #ffcc33;
    margin-bottom: 10px;
}

/* --- Guesstosterone: challenge screens --- */
.challenge-text {
    font-size: 1.6em;
    margin: 20px 0 10px;
}

.challenge-sub {
    color: #888;
    font-size: 1em;
}

/* --- Frequency slider --- */
.freq-display {
    font-size: 2.2em;
    color: #ffcc33;
    font-weight: bold;
    margin: 15px 0;
}

.freq-slider-wrap {
    margin-bottom: 15px;
}

.angle-number-input {
    width: 100px;
    padding: 8px 12px;
    font-size: 1.5em;
    text-align: center;
    background: #1a1a2e;
    border: 2px solid #444;
    border-radius: 8px;
    color: #f5a623;
    font-weight: bold;
    -moz-appearance: textfield;
}

.angle-number-input::-webkit-outer-spin-button,
.angle-number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.angle-number-input:focus {
    outline: none;
    border-color: #f5a623;
}

.freq-slider {
    width: 100%;
    margin: 10px 0;
    accent-color: #4ac;
}

.play-tone-btn {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    background: #3a5a8a;
    margin-bottom: 10px;
}

.play-tone-btn:hover:not(:disabled) {
    background: #4a6a9a;
}

/* --- Color sliders --- */
.color-preview {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    margin: 10px auto 20px;
    border: 3px solid #444;
    background: #808080;
}

.color-sliders {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
    text-align: left;
}

.color-sliders label {
    color: #aaa;
    font-size: 0.9em;
}

.color-sliders input[type=range] {
    width: 100%;
    accent-color: #ffcc33;
    margin-bottom: 4px;
}

#hue-slider {
    accent-color: #f66;
}

#sat-slider {
    accent-color: #6cf;
}

#bri-slider {
    accent-color: #fc6;
}

/* --- Admin panel --- */
.player-admin {
    color: #ffcc33;
    font-weight: bold;
}

.admin-panel-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 16px;
    font-size: 1em;
    background: #3a3a5a;
    border: 2px solid #ffcc33;
    border-radius: 10px;
    color: #ffcc33;
    cursor: pointer;
    z-index: 1000;
}

.admin-panel-btn:hover {
    background: #4a4a6a;
}

.admin-panel {
    position: fixed;
    bottom: 70px;
    right: 20px;
    width: 280px;
    max-height: 400px;
    background: #1a1a2e;
    border: 2px solid #ffcc33;
    border-radius: 12px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #2a2a3a;
    border-bottom: 1px solid #444;
}

.admin-panel-header h3 {
    margin: 0;
    font-size: 1em;
    color: #ffcc33;
}

.admin-panel-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.2em;
    cursor: pointer;
    padding: 2px 6px;
}

.admin-panel-close:hover {
    color: #fff;
    background: none;
}

.admin-player-list {
    overflow-y: auto;
    padding: 8px;
}

.admin-player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #2a2a3a;
    border-radius: 6px;
    margin-bottom: 6px;
}

.admin-player-name {
    font-size: 0.95em;
    color: #ccc;
}

.admin-player-name.admin-highlight {
    color: #ffcc33;
    font-weight: bold;
}

.admin-player-actions {
    display: flex;
    gap: 4px;
}

.admin-section-header {
    padding: 8px 14px;
    font-size: 0.85em;
    font-weight: bold;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #333;
}

.admin-game-controls {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid #333;
}

.admin-kick-btn,
.admin-ban-btn {
    padding: 4px 10px;
    font-size: 0.8em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.admin-kick-btn {
    background: #6a2222;
    color: #ffaaaa;
}

.admin-kick-btn:hover {
    background: #8a3333;
}

.admin-ban-btn {
    background: #5a1111;
    color: #ff8888;
}

.admin-ban-btn:hover {
    background: #7a2222;
}

/* --- Reconnecting overlay --- */
.reconnect-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 18, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.reconnect-box {
    text-align: center;
    color: #ffcc33;
    font-size: 1.3em;
}

.reconnect-spinner {
    width: 36px;
    height: 36px;
    margin: 16px auto 0;
    border: 4px solid #333;
    border-top-color: #ffcc33;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Profile screen --- */

#join-btn {
    position: relative;
    transition: opacity 0.2s;
}

#join-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#join-btn .btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

/* --- Profile screen --- */
.profile-btn {
    background: #3a3a5a !important;
    border: 2px solid #ffcc33 !important;
    color: #ffcc33 !important;
    font-size: 1em !important;
    padding: 10px !important;
}

.profile-btn:hover {
    background: #4a4a6a !important;
}

.profile-avatar-section {
    margin: 15px 0;
}

.profile-avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #2a2a3a;
    border: 3px solid #444;
    margin: 0 auto 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 0.85em;
}

.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.profile-avatar-actions button {
    padding: 8px 14px;
    font-size: 0.9em;
    background: #3a5a8a;
}

.profile-avatar-actions button:hover {
    background: #4a6a9a;
}

.profile-clear-btn {
    background: #6a2222 !important;
}

.profile-clear-btn:hover {
    background: #8a3333 !important;
}

#profile-draw-area {
    margin: 15px 0;
}

#profile-canvas {
    display: block;
    margin: 0 auto 10px;
    background: #fff;
    border-radius: 8px;
    touch-action: none;
    cursor: crosshair;
}

.profile-draw-tools {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.profile-palette {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
}

.profile-palette button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid #444;
    cursor: pointer;
    padding: 0;
}

.profile-draw-btns {
    display: flex;
    gap: 6px;
}

.profile-draw-btns button {
    padding: 6px 12px;
    font-size: 0.85em;
    background: #3a3a5a;
}

.profile-done-btn {
    width: 100%;
    background: #3a8a3a !important;
    padding: 10px !important;
}

.profile-color-section {
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.profile-color-section label {
    color: #ccc;
    font-size: 1em;
}

#profile-color-picker {
    width: 50px;
    height: 40px;
    border: 2px solid #444;
    border-radius: 6px;
    background: #2a2a3a;
    cursor: pointer;
    padding: 2px;
}

.profile-save-btn {
    width: 100%;
    padding: 14px !important;
    font-size: 1.1em !important;
    background: #3a8a3a !important;
    margin-top: 10px;
}

.profile-save-btn:hover {
    background: #4a9a4a !important;
}

/* --- Image crop UI --- */
#profile-crop-area {
    margin: 15px 0;
}

.crop-hint {
    color: #999;
    font-size: 0.85em;
    margin-bottom: 8px;
}

#crop-viewport {
    width: 280px;
    height: 280px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    border: 3px solid #ffcc33;
    position: relative;
    touch-action: none;
    cursor: grab;
    background: #111;
}

#crop-viewport:active {
    cursor: grabbing;
}

#crop-image {
    position: absolute;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.crop-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px auto;
    justify-content: center;
    max-width: 280px;
}

.crop-controls label {
    color: #aaa;
    font-size: 0.9em;
}

#crop-zoom-slider {
    flex: 1;
    accent-color: #ffcc33;
}

.crop-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.crop-btns button {
    padding: 10px 20px;
    font-size: 1em;
}

#crop-confirm-btn {
    background: #3a8a3a;
}

#crop-confirm-btn:hover {
    background: #4a9a4a;
}

#crop-cancel-btn {
    background: #6a2222;
}

#crop-cancel-btn:hover {
    background: #8a3333;
}

/* --- Profile camera --- */
#profile-camera-area {
    margin: 15px 0;
    text-align: center;
}

#profile-camera-video {
    display: block;
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 auto 10px;
    background: #000;
}

.profile-camera-btns {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.profile-camera-btns button {
    padding: 8px 18px;
    font-size: 0.95em;
}

#profile-capture-btn {
    background: #3a8a3a;
}

#profile-capture-btn:hover {
    background: #4a9a4a;
}

#profile-cancel-camera-btn {
    background: #6a2222;
}

#profile-cancel-camera-btn:hover {
    background: #8a3333;
}

#profile-switch-camera-btn {
    background: #3a5a8a;
}

#profile-switch-camera-btn:hover {
    background: #4a6a9a;
}

.sort-cube {
    transition: transform 0.2s ease;
}

/* ---------------------------------------------------------------------------
   File Upload Drop Zone
   --------------------------------------------------------------------------- */

.file-drop-zone {
    border: 2px dashed #555;
    border-radius: 12px;
    padding: 25px 15px;
    text-align: center;
    color: #888;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin: 10px 0;
}

.file-drop-zone:hover,
.file-drop-hover {
    border-color: #ffcc33;
    background: rgba(255, 204, 51, 0.05);
}

.file-drop-zone p {
    margin: 4px 0;
}

/* ---------------------------------------------------------------------------
   Clout Chasing
   --------------------------------------------------------------------------- */

.cc-header {
    text-align: center;
    margin-bottom: 10px;
}

.cc-victim-response {
    background: #2a2a3a;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    text-align: left;
}

.cc-matchups {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
    width: 100%;
}

.cc-matchup-card {
    background: #2a2a3a;
    border: 2px solid #444;
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.1s;
    text-align: left;
}

.cc-matchup-card:hover {
    border-color: #ffcc33;
    transform: scale(1.01);
}

.cc-matchup-selected {
    border-color: #5c5 !important;
    background: #2a4a2a !important;
}

.cc-matchup-victim {
    color: #aaa;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.cc-matchup-twist {
    color: #fff;
    font-size: 1.05em;
    font-weight: bold;
    margin: 6px 0;
}

.cc-matchup-media {
    max-width: 100%;
    max-height: 150px;
    border-radius: 6px;
    margin: 6px 0;
}

.cc-matchup-author {
    color: #888;
    font-size: 0.8em;
    font-style: italic;
}

.cc-matchup-own {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.cc-matchup-own:hover {
    border-color: #444;
    transform: none;
}

/* Upload preview & replace */
.cc-preview-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
}

.cc-preview-vid {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 8px;
}

.cc-replace-btn {
    display: block;
    margin: 8px auto 0;
    padding: 6px 18px;
    background: #444;
    color: #fff;
    border: 1px solid #666;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
}

.cc-replace-btn:hover {
    background: #555;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lightbox-img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 8px;
}

/* Crop UI */
.crop-container {
    text-align: center;
    padding: 10px 0;
}

.crop-title {
    color: #ffcc33;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.crop-canvas-wrap {
    position: relative;
    display: inline-block;
    touch-action: none;
}

.crop-canvas-wrap canvas {
    border-radius: 6px;
    display: block;
}

.crop-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.crop-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
}

.crop-btn-cancel {
    background: #444;
    color: #ccc;
}

.crop-btn-cancel:hover {
    background: #555;
}

.crop-btn-confirm {
    background: #ffcc33;
    color: #1a1a2e;
    font-weight: bold;
}

.crop-btn-confirm:hover {
    background: #ffd966;
}

/* Video Trim UI */
.trim-container {
    text-align: center;
    padding: 10px 0;
}

.trim-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 8px 0;
    color: #ccc;
    font-size: 0.85em;
}

.trim-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.trim-controls input[type="range"] {
    accent-color: #ffcc33;
}

/* ---------------------------------------------------------------------------
   Admin game control styles
   --------------------------------------------------------------------------- */

/* Lobby "Select Game" button */
.admin-lobby-controls {
    margin-top: 20px;
    text-align: center;
}

.admin-select-game-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 14px 28px;
    font-size: 1.1em;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

.admin-select-game-btn:active {
    background: #1d4ed8;
}

/* Game select view */
.admin-game-select {
    padding: 8px;
}

.admin-gs-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.admin-gs-header h2 {
    color: #ffcc33;
    font-size: 1.3em;
    margin: 0;
}

.admin-back-btn {
    background: #444;
    color: #ccc;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
}

.admin-back-btn:active {
    background: #555;
}

.admin-gs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-gs-item {
    background: #1e1e2a;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.admin-gs-item.focused {
    border-color: #3b82f6;
    background: #1a2540;
}

.admin-gs-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #fff;
}

.admin-gs-desc {
    color: #aaa;
    font-size: 0.85em;
    margin-top: 4px;
}

.admin-gs-meta {
    color: #888;
    font-size: 0.8em;
    margin-top: 4px;
}

.admin-gs-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.admin-settings-btn {
    background: #333;
    color: #ccc;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
}

.admin-settings-btn:active {
    background: #444;
}

.admin-start-btn {
    background: #22c55e;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95em;
}

.admin-start-btn:active {
    background: #16a34a;
}

.admin-start-btn.disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
}

/* Settings panel */
.admin-settings-panel {
    background: #14141e;
    border-radius: 10px;
    padding: 14px;
    margin-top: 12px;
}

.admin-settings-panel h3 {
    color: #ffcc33;
    margin: 0 0 10px 0;
    font-size: 1em;
}

.admin-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #222;
}

.admin-setting-label {
    color: #ccc;
    font-size: 0.85em;
    flex: 1;
}

.admin-setting-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-setting-desc {
    color: #888;
    font-size: 0.78em;
    font-style: italic;
    padding: 0 0 8px 0;
    border-bottom: 1px solid #222;
    margin-top: -4px;
}

.admin-customize-btn {
    background: #ffcc33;
    color: #111;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85em;
}

.admin-customize-btn:hover {
    background: #ffd966;
}

.admin-setting-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 8px;
    border-radius: 4px;
    background: #333;
    outline: none;
}

.admin-setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #4dcc66;
    cursor: pointer;
}

.admin-setting-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #4dcc66;
    border: none;
    cursor: pointer;
}

.admin-setting-slider::-moz-range-track {
    height: 8px;
    border-radius: 4px;
    background: #333;
}

.admin-setting-select {
    background: #1a1a2e;
    color: #fff;
    border: 1px solid #4dcc66;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.95em;
    cursor: pointer;
    min-width: 120px;
}

.admin-setting-dec,
.admin-setting-inc {
    background: #333;
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 1.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-setting-dec:active,
.admin-setting-inc:active {
    background: #555;
}

.admin-setting-value {
    color: #fff;
    font-size: 0.95em;
    min-width: 30px;
    text-align: center;
}

/* Content packs panel */
.admin-packs-panel {
    background: #14141e;
    border-radius: 10px;
    padding: 14px;
    margin-top: 12px;
}

.admin-packs-panel h3 {
    color: #ffcc33;
    margin: 0 0 10px 0;
    font-size: 1em;
}

.admin-pack-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    background: #1a1a2e;
    border: 1px solid #333;
    transition: background 0.15s;
}

.admin-pack-item:active {
    background: #252545;
}

.admin-pack-item.enabled {
    border-color: #4ade80;
}

.admin-pack-check {
    font-size: 1.3em;
    color: #4ade80;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.admin-pack-info {
    flex: 1;
    min-width: 0;
}

.admin-pack-name {
    color: #eee;
    font-size: 0.9em;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-pack-count {
    color: #888;
    font-size: 0.75em;
}

.admin-pack-empty {
    color: #666;
    font-size: 0.85em;
    padding: 8px 0;
}

/* In-game admin controls (inside admin panel) */
.admin-stop-btn {
    flex: 1;
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
}

.admin-stop-btn:active {
    background: #b91c1c;
}

.admin-skip-btn {
    flex: 1;
    background: #f59e0b;
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
}

.admin-skip-btn:active {
    background: #d97706;
}

/* ---------------------------------------------------------------------------
   Reactor — Full-screen tap button
   --------------------------------------------------------------------------- */

.reactor-tap-area {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 60vh;
    border-radius: 16px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s;
}

.reactor-tap-label {
    font-size: 3em;
    font-weight: bold;
    pointer-events: none;
}

.reactor-disabled {
    background: #333;
    color: #777;
    cursor: default;
}

.reactor-active {
    background: #2a8a2a;
    color: #fff;
    animation: reactor-pulse 0.6s ease-in-out infinite alternate;
}

.reactor-active:active {
    background: #1e6e1e;
}

.reactor-tapped {
    background: #2a2a3a;
    color: #5c5;
    cursor: default;
}

@keyframes reactor-pulse {
    from {
        background: #2a8a2a;
    }

    to {
        background: #3aba3a;
    }
}

/* --- Discovery Banner --- */
#discovery-banner {
    margin-bottom: 15px;
}

.discovery-card {
    background: #2a3a2a;
    border: 2px solid #3a8a3a;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.1s;
    text-align: center;
}

.discovery-card:hover {
    border-color: #ffcc33;
    transform: scale(1.02);
}

.discovery-card-title {
    font-size: 1.1em;
    color: #ffcc33;
    font-weight: bold;
    margin-bottom: 4px;
}

.discovery-card-info {
    color: #aaa;
    font-size: 0.9em;
}

.discovery-manual-link {
    color: #888;
    font-size: 0.85em;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 8px;
    display: inline-block;
}

.discovery-manual-link:hover {
    color: #ffcc33;
}

.discovery-manual-input {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.discovery-manual-input input {
    flex: 1;
    padding: 10px;
    font-size: 1em;
}

.discovery-manual-input button {
    padding: 10px 16px;
    font-size: 1em;
    white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Gartic Phone — Advanced Drawing Canvas
   --------------------------------------------------------------------------- */

#app.gp-draw-active {
    max-width: 900px;
}

.gp-draw-container {
    text-align: center;
}

.gp-ref-img {
    max-width: 100%;
    max-height: 120px;
    border-radius: 8px;
    margin: 0 auto 8px;
    display: block;
    background: #fff;
}

.gp-canvas-wrap {
    position: relative;
    display: inline-block;
    margin: 0 auto 10px;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}

.gp-canvas-wrap canvas {
    display: block;
    max-width: 100%;
    height: auto;
    background: #fff;
    touch-action: none;
    cursor: crosshair;
}

#gp-preview {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    background: transparent !important;
}

.gp-toolbar {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    margin: 8px 0;
}

.gp-toolbar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: #2a2a3a;
    border-radius: 8px;
}

.gp-tools-section {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
}

.gp-tool-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #444;
    background: #1a1a2e;
    color: #ccc;
    font-size: 1.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
}

.gp-tool-btn.gp-tool-active {
    border-color: #ffcc33;
    background: #3a3a5a;
    color: #fff;
}

.gp-tool-btn:hover {
    background: #3a3a5a;
}

.gp-picker-row {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

#gp-spectrum {
    border-radius: 4px;
    cursor: crosshair;
    touch-action: none;
}

#gp-hue-strip {
    border-radius: 4px;
    cursor: pointer;
    touch-action: none;
}

.gp-current-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #666;
    flex-shrink: 0;
}

.gp-quick-palette {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 200px;
    margin-top: 4px;
}

.gp-quick-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #555;
    cursor: pointer;
    padding: 0;
    transition: outline 0.1s;
}

.gp-quick-btn:hover {
    border-color: #aaa;
}

.gp-brush-section label {
    color: #aaa;
    font-size: 0.8em;
}

#gp-brush-slider {
    width: 100px;
    accent-color: #ffcc33;
}

.gp-brush-preview {
    border-radius: 50%;
    background: #fff;
    margin: 2px auto;
    min-width: 4px;
    min-height: 4px;
}

.gp-fill-toggle {
    padding: 4px 10px;
    font-size: 0.8em;
    background: #3a3a5a;
    border: 1px solid #666;
    border-radius: 4px;
    color: #ccc;
    cursor: pointer;
}

.gp-fill-toggle:hover {
    background: #4a4a6a;
}

.gp-size-presets {
    display: flex;
    gap: 4px;
}

.gp-size-btn {
    width: 32px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid #444;
    background: #2a2a3a;
    color: #ccc;
    cursor: pointer;
    font-size: 0.75em;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
}

.gp-size-btn:hover {
    background: #3a3a5a;
}

.gp-size-btn.gp-size-active {
    border-color: #ffcc33;
    background: #3a3a5a;
    color: #fff;
}

.gp-actions-section {
    flex-direction: row;
    gap: 6px;
}

.gp-actions-section button {
    padding: 8px 14px;
    font-size: 0.85em;
    background: #3a5a8a;
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}

.gp-actions-section button:hover {
    background: #4a6a9a;
}

@media (max-width: 600px) {
    .gp-toolbar {
        gap: 6px;
    }

    .gp-toolbar-section {
        padding: 6px;
    }

    .gp-tool-btn {
        width: 34px;
        height: 34px;
        font-size: 0.95em;
    }

    #gp-spectrum {
        width: 120px;
        height: 120px;
    }

    #gp-hue-strip {
        height: 120px;
    }

    .gp-actions-section button {
        padding: 6px 10px;
        font-size: 0.8em;
    }
}

/* -- Gartic Phone Reveal Chain UI -- */

.gp-reveal-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 0 8px;
    box-sizing: border-box;
    min-height: 70vh;
}

.gp-reveal-header {
    color: #ffcc33;
    font-size: 1.15em;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
    flex-shrink: 0;
}

.gp-reveal-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    flex: 1 1 auto;
    max-height: none;
    overflow-y: auto;
    padding: 4px 0;
}

.gp-reveal-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 6px;
    border-left: 3px solid #444;
    margin-left: 12px;
    transition: filter 0.4s ease, opacity 0.4s ease;
}

.gp-step-hidden {
    filter: blur(12px);
    opacity: 0.3;
    pointer-events: none;
    user-select: none;
}

.gp-step-visible {
    filter: none;
    opacity: 1;
}

.gp-step-label {
    color: #888;
    font-size: 0.75em;
    margin-bottom: 4px;
}

.gp-step-text {
    color: #fff;
    font-size: clamp(1.2em, 3vw, 2.2em);
    text-align: center;
    margin: 6px 0;
    word-break: break-word;
    line-height: 1.3;
}

.gp-step-img {
    width: auto;
    height: auto;
    max-width: 95%;
    max-height: 80vh;
    border-radius: 6px;
    margin: 4px auto;
    display: block;
    background: #fff;
    cursor: pointer;
    transition: opacity 0.15s;
}

.gp-step-img:hover {
    opacity: 0.85;
}

.gp-step-author {
    color: #7c7;
    font-size: 0.85em;
    margin-top: 2px;
}

.gp-reveal-admin-controls {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.gp-reveal-btn {
    padding: 10px 18px;
    font-size: 0.95em;
    background: #3a3a5a;
    border: 1px solid #555;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}

.gp-reveal-btn:hover {
    background: #4a4a6a;
}

.gp-reveal-btn-primary {
    background: #3a8a5a;
    border-color: #5a5;
}

.gp-reveal-btn-primary:hover {
    background: #4a9a6a;
}

/* Desktop: widen the app container when showing a Gartic Phone reveal */
@media (min-width: 600px) {
    #app:has(.gp-reveal-container) {
        max-width: 90vw;
    }

    .gp-reveal-container {
        padding: 0 24px;
    }

    .gp-step-text {
        font-size: clamp(1.4em, 2.5vw, 2.8em);
    }

    .gp-step-img {
        max-height: 85vh;
    }

    .gp-step-author {
        font-size: 1em;
    }

    .gp-step-label {
        font-size: 0.85em;
    }

    .gp-reveal-header {
        font-size: 1.4em;
    }
}

/* Death Quiz Mini-Game Styles */
.dq-minigame {
    text-align: center;
    padding: 20px 10px;
}

.dq-minigame h2 {
    color: #ff4444;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.dq-mash-btn {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: #cc2222;
    color: white;
    font-size: 2em;
    font-weight: bold;
    border: 4px solid #ff4444;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    margin: 15px auto;
    display: block;
    transition: transform 0.05s;
}

.dq-mash-btn:active {
    transform: scale(0.92);
    background: #991111;
}

.dq-tap-count {
    font-size: 3em;
    font-weight: bold;
    color: #ffcc00;
    margin: 10px 0;
}

.dq-equation {
    font-size: 2em;
    font-weight: bold;
    color: #ffcc00;
    margin: 20px 0;
    font-family: monospace;
}

.dq-scrambled {
    font-size: 2em;
    font-weight: bold;
    color: #ffcc00;
    letter-spacing: 0.15em;
    margin: 20px 0;
    font-family: monospace;
}

.dq-text-input {
    width: 80%;
    max-width: 300px;
    padding: 12px;
    font-size: 1.3em;
    text-align: center;
    border: 2px solid #555;
    border-radius: 8px;
    background: #2a2a3a;
    color: white;
    margin: 10px auto;
    display: block;
}

.dq-pick-prompt {
    font-size: 1.15em;
    color: #ffcc00;
    margin: 12px 0 18px;
    text-align: center;
}

.dq-pick-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    max-width: 360px;
    margin: 10px auto;
}

.dq-pick-btn {
    padding: 16px 12px;
    font-size: 1.1em;
    font-weight: bold;
    color: white;
    background: #3a2a3a;
    border: 2px solid #b44;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.05s, background 0.1s;
}

.dq-pick-btn:active:not(:disabled) {
    transform: scale(0.97);
    background: #552033;
}

.dq-pick-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.dq-pick-btn.dq-pick-selected {
    background: #8b2233;
    border-color: #ffcc00;
    opacity: 1;
}

/* Scratch Off grid */
.dq-scratch-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 250px;
    margin: 10px auto;
}

.dq-scratch-cell {
    width: 70px;
    height: 70px;
    font-size: 1.5em;
    background: #555;
    color: #fff;
    border: 2px solid #888;
    border-radius: 8px;
    cursor: pointer;
}

.dq-scratch-cell.scratched {
    background: #3a6a3a;
    border-color: #6c6;
}

.dq-scratch-cell:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Grid (Memory) */
.dq-grid {
    display: grid;
    gap: 4px;
    max-width: 300px;
    margin: 10px auto;
}

.dq-grid-cell {
    width: 100%;
    aspect-ratio: 1;
    background: #333;
    border: 1px solid #666;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
}

.dq-grid-cell.red {
    background: #a33;
}

/* Pattern Cards */
.dq-pattern-cards {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 10px auto;
}

.dq-pattern-card {
    padding: 12px 16px;
    background: #2a2a3a;
    border: 2px solid #888;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
}

.dq-pattern-card:hover {
    border-color: #ffcc00;
}

.dq-pattern-order {
    text-align: center;
    color: #aaa;
    margin: 8px 0;
    font-size: 0.9em;
}

/* Math Race */
.dq-math-score {
    font-size: 1.3em;
    font-weight: bold;
    color: #ffcc00;
    text-align: center;
    margin-bottom: 8px;
}

.dq-stun-overlay {
    font-size: 1.5em;
    color: #ff4444;
    text-align: center;
    font-weight: bold;
    animation: dq-stun-pulse 0.3s ease-in-out 3;
    margin-bottom: 8px;
}

.dq-stunned {
    opacity: 0.4;
}

@keyframes dq-stun-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* ============================================================
   RoboRally
   ============================================================ */

.rr-registers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.rr-register {
    width: 100%;
    min-height: 182px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.14), transparent 40%),
        linear-gradient(180deg, #f8eecf 0%, #ead7a1 100%);
    color: #2f2414;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    padding: 10px;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
}

.rr-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
}

.rr-register-drop-target {
    transform: translateY(-3px) scale(1.01);
    border-color: rgba(43, 139, 115, 0.9);
    box-shadow: 0 0 0 3px rgba(43, 139, 115, 0.18), 0 20px 36px rgba(0, 0, 0, 0.26);
}

.rr-register-empty {
    background: linear-gradient(180deg, #d8d0b4 0%, #c8bc94 100%);
    border-style: dashed;
    border-color: rgba(86, 64, 24, 0.35);
}

.rr-reg-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(49, 37, 17, 0.7);
    margin-bottom: 8px;
    text-align: left;
}

.rr-register-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
}

.rr-register-title {
    font-size: 0.95rem;
    text-align: left;
    line-height: 1.15;
    color: #2f2414;
}

.rr-register-hint {
    font-size: 0.72rem;
    color: rgba(49, 37, 17, 0.65);
    text-align: left;
}

.rr-register-empty-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px dashed rgba(62, 46, 20, 0.28);
    background: rgba(255, 255, 255, 0.26);
}

.rr-hand {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.rr-card {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 22px;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.16), transparent 35%),
        linear-gradient(180deg, #f9efcf 0%, #ead39a 100%);
    color: #2f2414;
    overflow: hidden;
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.24);
}

.rr-card-program {
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.16s, box-shadow 0.16s, opacity 0.16s;
}

.rr-card-program:hover:not(:disabled) {
    transform: translateY(-4px) rotate(-0.5deg);
    box-shadow: 0 22px 38px rgba(0, 0, 0, 0.3);
}

.rr-card-dragging {
    opacity: 0.35;
    transform: rotate(1.5deg);
}

.rr-card-program.used,
.rr-card-program:disabled {
    opacity: 0.42;
    cursor: default;
    transform: none;
}

.rr-upgrade-shop {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.rr-upgrade-card {
    display: flex;
    flex-direction: column;
}

.rr-card-upgrade {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rr-card-upgrade .rr-card-art {
    aspect-ratio: 1 / 0.58;
}

.rr-card-upgrade .rr-card-body {
    gap: 6px;
    min-height: 64px;
}

.rr-card-upgrade .rr-card-title {
    font-size: 0.92rem;
}

.rr-card-upgrade .rr-card-text {
    font-size: 0.74rem;
    line-height: 1.25;
}

.rr-card-upgrade .rr-card-action {
    min-height: 36px;
    font-size: 0.88rem;
    padding: 8px 10px;
}

.rr-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.rr-card-chip,
.rr-card-cost {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(69, 47, 13, 0.1);
    color: #5c451d;
}

.rr-card-cost {
    font-weight: 700;
}

.rr-card-art {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 0.82;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(24, 52, 74, 0.2), rgba(213, 159, 46, 0.24));
    border: 1px solid rgba(62, 46, 20, 0.16);
}

.rr-card-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rr-card-art-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
}

.rr-card-art-fallback span {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.88);
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}

.rr-card-art-mini {
    aspect-ratio: 1 / 0.62;
}

.rr-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 90px;
}

.rr-card-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.15;
    color: #2f2414;
}

.rr-card-text {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.35;
    color: rgba(47, 36, 20, 0.78);
}

.rr-card-action {
    margin-top: auto;
    width: 100%;
    border: none;
    border-radius: 14px;
    min-height: 42px;
    background: linear-gradient(180deg, #274d67 0%, #163244 100%);
    color: #f5eed9;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
}

.rr-card-action:hover {
    filter: brightness(1.06);
}

.rr-card-placeholder {
    font-size: 1rem;
    color: rgba(47, 36, 20, 0.52);
    font-weight: 700;
}

.rr-kind-move .rr-card-art {
    background: linear-gradient(135deg, #5588b5 0%, #17385e 100%);
}

.rr-kind-turn .rr-card-art {
    background: linear-gradient(135deg, #d18a44 0%, #693018 100%);
}

.rr-kind-utility .rr-card-art {
    background: linear-gradient(135deg, #6a61aa 0%, #2d265a 100%);
}

.rr-kind-upgrade .rr-card-art {
    background: linear-gradient(135deg, #2b8b73 0%, #114637 100%);
}

.rr-activation-flow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin: 18px 0 16px;
}

.rr-activation-node {
    position: relative;
    min-height: 76px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(42, 42, 58, 0.92) 0%, rgba(30, 30, 44, 0.96) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    text-align: left;
    color: #d8d8e6;
}

.rr-activation-node.active {
    border-color: rgba(255, 204, 51, 0.9);
    background: linear-gradient(180deg, rgba(76, 58, 14, 0.96) 0%, rgba(58, 42, 10, 0.98) 100%);
    box-shadow: 0 0 0 3px rgba(255, 204, 51, 0.16), 0 16px 28px rgba(0, 0, 0, 0.24);
    color: #fff5d2;
}

.rr-activation-index {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
}

.rr-activation-node.active .rr-activation-index {
    color: rgba(255, 245, 210, 0.74);
}

.rr-activation-label {
    font-size: 0.9rem;
    line-height: 1.15;
    font-weight: 700;
}

.rr-activation-panel {
    margin-top: 10px;
    padding: 18px 18px 20px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(35, 36, 54, 0.96) 0%, rgba(24, 25, 38, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

.rr-activation-current {
    font-size: 1.05rem;
    line-height: 1.35;
    color: #fff2c4;
    font-weight: 700;
}

.rr-activation-detail {
    margin-top: 10px;
    font-size: 0.88rem;
    line-height: 1.35;
    color: #c9cede;
}

@media (max-width: 600px) {
    .rr-registers {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rr-hand {
        grid-template-columns: 1fr;
    }

    .rr-upgrade-shop {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .rr-card-upgrade {
        padding: 7px;
        gap: 7px;
    }

    .rr-card-upgrade .rr-card-chip,
    .rr-card-upgrade .rr-card-cost {
        min-height: 24px;
        padding: 0 8px;
        font-size: 0.64rem;
    }

    .rr-card-upgrade .rr-card-art {
        aspect-ratio: 1 / 0.5;
        border-radius: 12px;
    }

    .rr-card-upgrade .rr-card-body {
        min-height: 56px;
    }

    .rr-card-upgrade .rr-card-title {
        font-size: 0.84rem;
    }

    .rr-card-upgrade .rr-card-text {
        font-size: 0.68rem;
        line-height: 1.2;
    }

    .rr-card-upgrade .rr-card-action {
        min-height: 32px;
        border-radius: 10px;
        font-size: 0.78rem;
        padding: 7px 8px;
    }

    .rr-register {
        min-height: 168px;
    }

    .rr-activation-flow {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 380px) {
    .rr-upgrade-shop {
        grid-template-columns: 1fr;
    }
}

.rr-card-desc {
    font-size: 0.75rem;
    color: #aaa;
}

.gp-crowd-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0;
}

.gp-crowd-option {
    background: #1a1a2e;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: #fff;
}

.gp-crowd-option:hover {
    border-color: #7c7;
}

.gp-imposter-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0;
}

.gp-imposter-option {
    padding: 12px;
    font-size: 1em;
}
/* Death Quiz: Final Escape multi-select UI */
.dq-final-hint { color: #aaa; margin: 8px 0 12px; font-size: 0.95em; }
.dq-final-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.dq-final-option { display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    background: #1f2330; border: 2px solid #3a3f54; border-radius: 8px; cursor: pointer;
    color: #f0f0f0; font-size: 1.05em; }
.dq-final-option input[type="checkbox"] { width: 22px; height: 22px; accent-color: #ffae3b; }
.dq-final-submit { width: 100%; margin-top: 6px; }
.dq-final-tracks { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.dq-final-track { display: flex; flex-direction: column; gap: 2px; }
.dq-final-track-label { color: #d0d0e0; font-size: 0.85em; }
.dq-final-track-bar { width: 100%; height: 14px; background: #181a22; border: 1px solid #3a3f54; border-radius: 4px; overflow: hidden; }
.dq-final-track-fill { height: 100%; background: linear-gradient(90deg, #ffb13b, #ff5e3a); transition: width 0.4s ease; }
.dq-status-scores { color: #c8c8d8; font-size: 0.85em; margin-top: 4px; }
