/* Settings Screen Styles */
/* Designed to fit on single screen without scrolling */

#settings-screen {
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.settings-layout {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(8px, 1.5vh, 24px);
    max-height: 100vh;
    box-sizing: border-box;
}

.settings-content {
    max-width: min(600px, 95vw);
    max-height: 95vh;
    width: 100%;
    background: var(--bg-medium);
    padding: clamp(12px, 2vh, 32px);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow:
        inset -4px -4px 0 0 #0a0a0f,
        inset 4px 4px 0 0 #2a2a3a,
        0 0 0 4px var(--blue-medium),
        8px 8px 0 0 rgba(0, 0, 0, 0.5);
}

.settings-content h2 {
    font-family: var(--font-pixel);
    font-size: clamp(14px, 2.5vh, 28px);
    color: var(--blue-light);
    text-align: center;
    margin-bottom: clamp(8px, 1.5vh, 24px);
    text-shadow: 3px 3px 0 var(--blue-dark);
    letter-spacing: 3px;
    flex-shrink: 0;
}

.settings-section {
    margin-bottom: clamp(6px, 1vh, 16px);
    padding-bottom: clamp(6px, 1vh, 16px);
    border-bottom: 3px solid var(--border-color);
}

.settings-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section .section-header {
    font-family: var(--font-pixel);
    font-size: clamp(10px, 1.2vh, 14px);
    color: var(--purple);
    letter-spacing: 2px;
    margin-bottom: var(--gap-md);
    padding-bottom: var(--gap-xs);
    border-bottom: 2px solid var(--purple);
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--gap-sm) 0;
    gap: var(--gap-md);
}

.setting-row label {
    font-family: var(--font-retro);
    font-size: clamp(14px, 1.8vh, 20px);
    color: var(--text-medium);
    flex: 1;
}

.setting-row input[type="range"] {
    width: clamp(100px, 15vw, 180px);
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    cursor: pointer;
}

.setting-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--blue-medium);
    border: 3px solid var(--blue-light);
    cursor: pointer;
}

.setting-row input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--blue-medium);
    border: 3px solid var(--blue-light);
    cursor: pointer;
    border-radius: 0;
}

.setting-row input[type="range"]:hover::-webkit-slider-thumb {
    background: var(--blue-light);
    box-shadow: 0 0 10px var(--blue-glow);
}

.setting-value {
    font-family: var(--font-pixel);
    font-size: clamp(10px, 1.2vh, 14px);
    color: var(--blue-light);
    min-width: 45px;
    text-align: right;
}

.toggle-btn {
    font-family: var(--font-pixel);
    font-size: clamp(10px, 1.2vh, 14px);
    padding: var(--gap-sm) var(--gap-md);
    background: var(--bg-dark);
    color: var(--text-dim);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow:
        inset -2px -2px 0 0 #050508,
        inset 2px 2px 0 0 #1a1a25,
        0 0 0 2px var(--border-color);
}

.toggle-btn.active {
    background: var(--green);
    color: white;
    box-shadow:
        inset -2px -2px 0 0 #14532d,
        inset 2px 2px 0 0 #4ade80,
        0 0 0 2px var(--green),
        0 0 15px rgba(34, 197, 94, 0.3);
}

.toggle-btn:hover {
    transform: scale(1.05);
}

/* Save/Import area */
.save-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--gap-sm);
}

.export-area,
.import-area {
    margin-top: var(--gap-md);
    padding: var(--gap-md);
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
}

.export-area textarea,
.import-area textarea {
    width: 100%;
    height: 80px;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    color: var(--text-medium);
    font-family: var(--font-mono);
    font-size: clamp(10px, 1.2vh, 14px);
    padding: var(--gap-sm);
    resize: none;
    margin-bottom: var(--gap-sm);
}

.export-area textarea:focus,
.import-area textarea:focus {
    outline: none;
    border-color: var(--blue-medium);
}

/* Settings actions */
.settings-actions {
    display: flex;
    justify-content: center;
    gap: var(--gap-lg);
    margin-top: var(--gap-xl);
}

/* Poker Hand Display */
.poker-hand-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1500;
    text-align: center;
    pointer-events: none;
    animation: poker-hand-appear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes poker-hand-appear {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3) rotate(5deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

.poker-hand-display .hand-name {
    font-family: var(--font-pixel);
    font-size: clamp(24px, 5vh, 48px);
    color: var(--gold);
    text-shadow:
        0 0 20px var(--gold),
        0 0 40px var(--orange),
        4px 4px 0 #8B4513;
    margin-bottom: var(--gap-md);
    animation: hand-name-pulse 0.5s ease infinite;
}

@keyframes hand-name-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.poker-hand-display .hand-score {
    font-family: var(--font-pixel);
    font-size: clamp(18px, 3vh, 32px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--gap-sm);
}

.poker-hand-display .chips {
    color: var(--blue-light);
    text-shadow: 2px 2px 0 var(--blue-dark);
}

.poker-hand-display .mult-symbol {
    color: var(--text-dim);
}

.poker-hand-display .mult {
    color: var(--red);
    text-shadow: 2px 2px 0 #7f1d1d;
}

/* Reduced motion support */
.reduced-motion * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

.reduced-motion .scanlines {
    display: none !important;
}

/* No CRT mode */
.no-crt {
    background: var(--bg-dark) !important;
    box-shadow: none !important;
}

.no-crt::before,
.no-crt::after {
    display: none !important;
}

/* Grid cell rank display */
.grid-cell.filled .cell-rank {
    position: absolute;
    top: 2px;
    left: 2px;
    font-family: var(--font-pixel);
    font-size: clamp(8px, 1vh, 12px);
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
    z-index: 5;
    line-height: 1;
}

/* Piece slot rank/suit display */
.piece-slot .piece-info {
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--font-pixel);
    font-size: clamp(10px, 1.2vh, 14px);
    color: var(--text-bright);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
    z-index: 5;
}

.piece-slot .piece-info .piece-rank {
    color: white;
}

.piece-slot .piece-info .piece-suit {
    margin-left: 2px;
}

.piece-slot .piece-info .piece-suit.hearts { color: var(--hearts); }
.piece-slot .piece-info .piece-suit.diamonds { color: var(--diamonds); }
.piece-slot .piece-info .piece-suit.clubs { color: var(--clubs); }
.piece-slot .piece-info .piece-suit.spades { color: var(--spades); }

/* Streak display enhancement */
.streak-indicator {
    position: fixed;
    bottom: var(--gap-lg);
    right: var(--gap-lg);
    font-family: var(--font-pixel);
    font-size: clamp(12px, 1.5vh, 18px);
    color: var(--orange);
    text-shadow: 2px 2px 0 #7c2d12;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: var(--gap-xs);
}

.streak-indicator.hot {
    color: var(--red);
    animation: streak-fire 0.3s ease infinite;
}

.streak-indicator.blazing {
    color: var(--gold);
    font-size: clamp(16px, 2vh, 24px);
    animation: jackpot 1s ease infinite;
}

@keyframes streak-fire {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.5); }
}

/* Hand info panel enhancement */
.hand-info-panel {
    background: var(--bg-medium);
    padding: var(--gap-sm);
    margin-top: var(--gap-sm);
    box-shadow:
        inset -2px -2px 0 0 #0a0a0f,
        inset 2px 2px 0 0 #2a2a3a;
}

.hand-info-panel .hand-type {
    font-family: var(--font-pixel);
    font-size: clamp(8px, 1vh, 11px);
    color: var(--purple);
    letter-spacing: 1px;
}

.hand-info-panel .hand-level {
    font-family: var(--font-retro);
    font-size: clamp(12px, 1.4vh, 16px);
    color: var(--text-medium);
}

/* Joker/card price tag improvements */
.card-price {
    position: absolute;
    bottom: -8px;
    right: -8px;
    min-width: 28px;
    height: 24px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-pixel);
    font-size: clamp(8px, 1vh, 11px);
    color: #1c1917;
    font-weight: bold;
    z-index: 20;
    padding: 0 4px;
    box-shadow:
        inset -2px -2px 0 0 #92400e,
        inset 2px 2px 0 0 #fde68a,
        0 2px 0 0 #78350f;
}

.card.cant-afford {
    opacity: 0.5;
}

.card.cant-afford .card-price {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    box-shadow:
        inset -2px -2px 0 0 #334155,
        inset 2px 2px 0 0 #94a3b8,
        0 2px 0 0 #1e293b;
}

/* Save Slots Grid */
.save-slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap-md);
    margin-top: var(--gap-sm);
}

@media (max-width: 600px) {
    .save-slots-grid {
        grid-template-columns: 1fr;
    }
}

.save-slot {
    background: var(--bg-dark);
    padding: var(--gap-md);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    box-shadow:
        inset -3px -3px 0 0 #050508,
        inset 3px 3px 0 0 #1a1a25,
        0 0 0 2px var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.save-slot:hover {
    transform: translateY(-2px);
}

.save-slot.filled {
    box-shadow:
        inset -3px -3px 0 0 #1e3a8a,
        inset 3px 3px 0 0 #3b82f6,
        0 0 0 2px var(--blue-medium),
        0 0 15px rgba(59, 130, 246, 0.2);
}

.save-slot.empty {
    opacity: 0.7;
}

.slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--gap-sm);
}

.slot-name {
    font-family: var(--font-pixel);
    font-size: clamp(10px, 1.2vh, 14px);
    color: var(--text-bright);
}

.slot-mode {
    font-size: clamp(14px, 1.8vh, 20px);
}

.slot-info {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-retro);
    font-size: clamp(12px, 1.4vh, 16px);
    color: var(--text-medium);
    margin-bottom: var(--gap-xs);
}

.slot-date {
    font-family: var(--font-retro);
    font-size: clamp(10px, 1vh, 12px);
    color: var(--text-dim);
    margin-bottom: var(--gap-sm);
}

.slot-empty-text {
    font-family: var(--font-retro);
    font-size: clamp(14px, 1.6vh, 18px);
    color: var(--text-dim);
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slot-actions {
    display: flex;
    gap: var(--gap-xs);
    margin-top: auto;
}

.slot-actions .crt-button.small {
    font-size: clamp(8px, 1vh, 11px);
    padding: var(--gap-xs) var(--gap-sm);
    flex: 1;
}

.crt-button.danger {
    background: linear-gradient(180deg, #7f1d1d 0%, #450a0a 100%);
    box-shadow:
        inset -3px -3px 0 0 #450a0a,
        inset 3px 3px 0 0 #b91c1c,
        0 0 0 3px var(--red);
}

.crt-button.danger:hover {
    background: linear-gradient(180deg, #991b1b 0%, #7f1d1d 100%);
    box-shadow:
        inset -3px -3px 0 0 #7f1d1d,
        inset 3px 3px 0 0 #dc2626,
        0 0 0 3px var(--red),
        0 0 20px rgba(239, 68, 68, 0.4);
}
