/* --- STEAM DECK SPECIFIC ADJUSTMENTS --- */
body.steam-deck-mode #game-area {
    justify-content: flex-start; 
    padding-top: 60px;
}

body.steam-deck-mode #word-display {
    margin: 10px 0 20px 0;
}

body.steam-deck-mode #input-box {
    margin-top: 10px;
}

body.steam-deck-mode #game-logo {
    top: 15% !important;
}

body.steam-deck-mode #timer {
    margin-bottom: 20px;
}

/* --- COMPACT SHOP STYLES (Steam Deck Optimization) --- */

.shop-compact-container {
    width: 100%;
    text-align: left;
    font-family: 'Rajdhani', sans-serif;
}

.shop-compact-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    justify-content: space-between;
}

.sc-title {
    font-size: 1.4rem;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.sc-meta {
    font-size: 0.85rem;
    color: #888;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    display: flex;
    gap: 6px;
    align-items: center;
}

.sc-brand {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.shop-compact-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sc-desc {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.2;
    font-style: italic;
}

.sc-stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 4px;
}

.sc-impact {
    color: #fff;
    font-weight: bold;
    font-size: 0.95rem;
}

.sc-compare {
    font-family: 'Courier New', monospace;
    font-weight: 900;
    font-size: 1rem;
    background: rgba(0,0,0,0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

.sc-val.curr { color: #888; }
.sc-val.next { text-shadow: 0 0 5px rgba(46, 213, 115, 0.3); }
.arrow { color: #555; margin: 0 5px; }

.sess-icon {
    margin-right: 10px;
    font-size: 1rem;
    font-weight: bold;
    color: #666;
    font-family: monospace;
}

/* Steam Deck Button Prompts */
.deck-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #333;
    border: 1px solid #666;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
    font-weight: bold;
    color: #fff;
    margin-right: 8px;
    box-shadow: 0 2px 0 #111;
    font-family: sans-serif;
    vertical-align: middle;
}

.deck-btn.menu {
    border-radius: 4px;
    width: 26px;
    font-size: 0.9rem;
}

/* Gamepad Focus Styles */
:focus {
    outline: none; /* Remove default browser outline */
}

/* Highlighting for cards/buttons when focused by controller */
.slot-card:focus, 
.shop-card:focus, 
.diff-card:focus, 
.theme-card:focus, 
.challenge-card:focus,
.btn-round:focus,
.opt-menu-btn:focus,
.opt-sys-btn:focus {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--accent);
    border-color: var(--accent);
    z-index: 10;
    position: relative;
}

/* Specific color tweaks for focus states */
.opt-sys-btn.danger:focus {
    box-shadow: 0 0 15px #ff0000;
    border-color: #ff0000;
}

/* Visual Feedback when A is pressed */
.btn-pressed {
    transform: scale(0.95) !important;
    filter: brightness(1.5);
}

/* Container: Switch to Row direction */
#virtual-keyboard {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    
    display: flex; 
    flex-direction: row; 
    justify-content: center;
    align-items: center;
    
    gap: 30px;
    padding: 20px;
    z-index: 100000 !important;
    
    transform: translateY(100%); 
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1); 
    pointer-events: none; 
    visibility: hidden;
}

#virtual-keyboard.vk-visible {
    transform: translateY(0); 
    pointer-events: auto;
    visibility: visible;
}

.vk-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 3; 
    max-width: 900px;
}

.vk-right {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    grid-template-rows: repeat(3, 1fr);
    gap: 6px;
    flex: 1;
    max-width: 400px;
}

/* Existing Button Styles (Preserved) */
.vk-btn {
    background: var(--bg); 
    color: var(--text); 
    border: 1px solid var(--border);
    border-radius: 4px; 
    padding: 0;
    font-family: 'Courier New', monospace; 
    font-size: 2rem; 
    font-weight: bold; 
    cursor: pointer; 
    
    /* Center text in button */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    transition: all 0.1s; 
    user-select: none; 
}

.vk-row {
    display: flex;
    gap: 4px;
    justify-content: center;
}

/* Specific sizing */
.vk-btn.wide { 
    min-width: 80px; 
}

.vk-btn.extra-wide { 
    width: 400px; 
    max-width: 100%;
}

/* Active States */
.vk-btn:active, .vk-btn.active {
    background: var(--accent); 
    color: var(--bg); 
    border-color: var(--accent);
    transform: scale(0.95);
}

/* Symbol Colors */
.vk-right .vk-btn, .vk-btn[data-key="."], .vk-btn[data-key="/"], .vk-btn[data-key=":"] {
    color: var(--accent);
    font-weight: 900;
}

.vk-btn.adventure-key {
    border-color: #ff3366 !important;
    color: #ff3366 !important;
    background: rgba(255, 51, 102, 0.1) !important;
    box-shadow: 0 0 15px rgba(255, 51, 102, 0.4) !important;
    animation: keyPulse 1s infinite alternate;
}

@keyframes keyPulse {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 51, 102, 0.2); }
    100% { transform: scale(1.05); box-shadow: 0 0 20px rgba(255, 51, 102, 0.6); }
}

/* When Steam Deck Mode AND Adventure Mode are active */
body.steam-deck-mode.adventure-mode #adventure-layer {
    justify-content: flex-start;
    padding-top: 20px;
}

/* Scale down the grid slightly to fit above the keyboard */
body.steam-deck-mode.adventure-mode #adv-grid {
    width: 380px;
    height: 380px;
    gap: 2px;
    margin-bottom: 0;
    margin-top: 18px;
}

body.steam-deck-mode.adventure-mode #adv-header {
    top: 20px !important;
}
body.steam-deck-mode.adventure-mode #adv-timer-container {
    margin-bottom: 270px;
}

/* Move the input box to a specific spot above the VK */
body.steam-deck-mode.adventure-mode #input-box {
    bottom: 320px !important;
    left: 38% !important;
    transform: none !important;
}