/**
 * marsRocketWords Global Style Sheet
 * 
 * Responsive design for desktop and mobile devices
 * Light and Dark theme with Mars-inspired color palette
 * Theme switching via CSS variables
 */

/* Theme variables are defined in themes.css (html[data-theme="..."]).
   Fallback values below match the dark theme for graceful degradation. */
:root {
    --bg-primary:       #000000;
    --bg-secondary:     #0d0d0d;
    --bg-tertiary:      #1a1a1a;
    --bg-quaternary:    #242424;
    --bg-gradient:      linear-gradient(135deg, #000000 0%, #111111 100%);
    --text-primary:     #e0e0e0;
    --text-secondary:   #a8a8a8;
    --text-muted:       #666666;
    --text-dark-muted:  #555555;
    --border-light:     rgba(255,255,255,0.10);
    --border-lighter:   rgba(255,255,255,0.25);
    --border-color:     rgba(255,255,255,0.14);
    --accent-primary:   #ff6b35;
    --accent-secondary: #d32f2f;
    --accent-success:   #4caf50;
    --accent-info:      #2196f3;
    --accent-warning:   #ff9800;
    --accent-danger:    #f44336;
    --overlay-light:    rgba(255,255,255,0.05);
    --overlay-lighter:  rgba(255,255,255,0.08);
    --overlay-dark:     rgba(0,0,0,0.30);
    --overlay-darker:   rgba(0,0,0,0.50);
    --input-bg:         rgba(255,255,255,0.05);
    --input-bg-hover:   rgba(255,255,255,0.09);
    --box-shadow:       0 8px 32px rgba(0,0,0,0.50);
    --box-shadow-lg:    0 16px 48px rgba(0,0,0,0.70);
    --color-primary:    #ff6b35;
    --color-secondary:  #d32f2f;
    /* Background image vars — defaults for built-in themes that use gradient */
    --bg-image:         var(--bg-gradient);
    --bg-size:          auto;
    --bg-repeat:        no-repeat;
    --bg-position:      center center;
    --bg-attachment:    scroll;
}

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    background-image: var(--bg-image);
    background-size: var(--bg-size);
    background-repeat: var(--bg-repeat);
    background-position: var(--bg-position);
    background-attachment: var(--bg-attachment);
    min-height: 100vh;
    cursor: url('../images/mars_cursor.cur'), auto;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Force rocket cursor on all clickable/interactive elements */
a, button, [role="button"], label, select, summary,
input[type="submit"], input[type="button"], input[type="reset"],
input[type="checkbox"], input[type="radio"],
.btn, .btn-primary, .btn-secondary, .btn-danger,
.theme-picker-btn, .theme-picker-option,
.consent-btn, .cookie-settings-link,
[onclick], [tabindex] {
    cursor: url('../images/mars_cursor.cur'), pointer !important;
}

/* Logo Header */
.logo-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--bg-primary);
    border-bottom: none;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.logo-header img {
    height: 40px;
    width: auto;
    display: block;
}

.logo-header-title {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.gameHeader {
    text-align: center;
    padding: 30px 0 20px 0;
    margin-bottom: 30px;
}

.gameTitle {
    font-size: 48px;
    font-weight: 900;
    background: linear-gradient(135deg, #ff6b35 0%, #d32f2f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.gameSubtitle {
    font-size: 18px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Main Content */
.gameMain {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.gamePhase {
    width: 100%;
    animation: fadeIn 0.3s ease-in;
}

.gamePhase.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Setup Card */
.setupCard {
    background: var(--overlay-light);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 40px;
    max-width: 500px;
    margin: 0 auto;
    backdrop-filter: blur(10px);
    box-shadow: var(--box-shadow);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.setupCard h2 {
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--accent-primary);
}

/* Input Groups */
.inputGroup {
    margin-bottom: 25px;
}

.inputGroup label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.labelText {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.playerLabel {
    font-weight: 700;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.playerLabel.playerA {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.playerLabel.playerB {
    background-color: rgba(33, 150, 243, 0.2);
    color: #2196f3;
}

.wordInput {
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.wordInput:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--input-bg-hover);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.2);
}

.inputHint {
    font-size: 12px;
    color: var(--text-muted);
}

/* Mode Selector */
.modeSelector {
    margin-bottom: 30px;
}

.modeOptions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.radioLabel {
    display: flex;
    align-items: center;
    gap: 12px;
    /* cursor inherited from global rocket rule */
    padding: 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.radioLabel:hover {
    background: rgba(255, 107, 53, 0.1);
}

.radioLabel input[type="radio"] {
    /* cursor inherited from global rocket rule */
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

.radioText {
    font-size: 14px;
    color: var(--text-primary);
}

/* Buttons */
.primaryBtn, .secondaryBtn, .tertiaryBtn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    /* cursor inherited from global rocket rule */
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.primaryBtn {
    width: 100%;
    background: linear-gradient(135deg, #ff6b35 0%, #d32f2f 100%);
    color: white;
    margin-top: 10px;
}

.primaryBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.4);
}

.primaryBtn:active {
    transform: translateY(0);
}

.secondaryBtn {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid #4caf50;
    flex: 1;
}

.secondaryBtn:hover {
    background: rgba(76, 175, 80, 0.3);
}

.tertiaryBtn {
    background: rgba(158, 158, 158, 0.2);
    color: var(--text-secondary);
    border: 1px solid rgba(158, 158, 158, 0.5);
}

.tertiaryBtn:hover {
    background: rgba(158, 158, 158, 0.3);
}

/* Game Board Layout */
.gameBoard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.gameDivider {
    background: linear-gradient(to bottom, transparent, rgba(255, 107, 53, 0.3), transparent);
    width: 2px;
    border-radius: 2px;
}

/* Player Panel */
.playerPanel {
    background: var(--overlay-light);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 25px;
    backdrop-filter: blur(10px);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.playerPanel-a {
    border-left: 3px solid #4caf50;
}

.playerPanel-b {
    border-left: 3px solid #2196f3;
}

.playerHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stats {
    display: flex;
    gap: 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.statLabel {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.statValue {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-primary);
}

/* Word Display */
.wordDisplay {
    background: var(--overlay-dark);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
    transition: background 0.3s ease;
}

.wordLabel {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.word {
    display: block;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
    color: #4caf50;
}

.playerPanel-b .word {
    color: #2196f3;
}

.target {
    display: block;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
}

/* Move Input */
.moveInput {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.moveSelect, .moveInput-params {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.moveSelect:focus, .moveInput-params:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--input-bg-hover);
}

.moveSelect {
    /* cursor inherited from global rocket rule */
}

.moveSelect option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Game Log */
.gameLog {
    background: var(--overlay-light);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.gameLog h3 {
    color: var(--accent-primary);
    margin-bottom: 15px;
    font-size: 16px;
}

.moveList {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.moveItem {
    display: grid;
    grid-template-columns: auto 120px 1fr auto;
    gap: 12px;
    align-items: center;
    background: var(--overlay-dark);
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    transition: background 0.3s ease;
}

.moveType {
    color: var(--accent-primary);
    font-weight: 600;
}

.moveTransform {
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.moveTurn {
    color: var(--text-muted);
    text-align: right;
}

/* Game Actions */
.gameActions {
    text-align: center;
}

/* Footer */
.gameFooter {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 14px;
    border-top: 1px solid var(--border-light);
    margin-top: 40px;
    transition: border-color 0.3s ease;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--overlay-dark);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 53, 0.5);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 53, 0.7);
}
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gameBoard {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .gameDivider {
        display: none;
    }
    
    .gameTitle {
        font-size: 36px;
    }
    
    .setupCard {
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    .logo-header {
        gap: 12px;
        padding: 12px 15px;
    }

    .logo-header img {
        height: 35px;
    }

    .logo-header-title {
        font-size: 18px;
    }

    .gameHeader {
        padding: 20px 0 15px 0;
        margin-bottom: 20px;
    }
    
    .gameTitle {
        font-size: 32px;
    }
    
    .gameSubtitle {
        font-size: 14px;
    }
    
    .setupCard {
        max-width: 100%;
        padding: 25px 20px;
    }
    
    .playerHeader {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .stats {
        width: 100%;
        justify-content: space-around;
    }
    
    .moveItem {
        grid-template-columns: auto 1fr;
        gap: 8px;
    }
    
    .moveType, .moveTurn {
        order: -1;
    }
    
    .word {
        font-size: 28px;
        letter-spacing: 2px;
    }
    
    .target {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .logo-header {
        gap: 10px;
        padding: 10px 12px;
    }

    .logo-header img {
        height: 30px;
    }

    .logo-header-title {
        font-size: 16px;
    }

    .container {
        padding: 0 15px;
    }
    
    .gameTitle {
        font-size: 24px;
        letter-spacing: 1px;
    }
    
    .gameSubtitle {
        font-size: 12px;
    }
    
    .setupCard, .playerPanel, .gameLog {
        padding: 20px 15px;
        border-radius: 8px;
    }
    
    .setupCard h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .wordInput {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .inputHint {
        font-size: 11px;
    }
    
    .word {
        font-size: 24px;
        letter-spacing: 2px;
    }
    
    .stat {
        gap: 2px;
    }
    
    .statValue {
        font-size: 20px;
    }
    
    .statLabel {
        font-size: 11px;
    }
    
    .moveList {
        max-height: 250px;
    }
    
    .moveItem {
        padding: 8px;
        font-size: 12px;
    }
}

/* ============================================================================
   AdSense Footer Component
   ============================================================================ */

.adsense-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.5s ease;
    padding: 10px 20px;
    min-height: 90px;
    max-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
}

.adsense-footer.collapsed {
    min-height: 20px;
    max-height: 20px;
    padding: 0;
    overflow: hidden;
}

.adsense-footer.hidden {
    display: none;
}

/* Footer content wrapper */
.adsense-footer-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Footer info section */
.footer-info {
    text-align: center;
    width: 100%;
}

.footer-branding {
    margin-bottom: 8px;
}

.footer-branding h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.footer-branding p {
    margin: 3px 0 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-links {
    font-size: 12px;
}

.footer-link {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.link-separator {
    color: var(--text-muted);
    margin: 0 8px;
}

/* Grabber indicator - always visible for clicking */
.adsense-footer-grabber {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 2px;
    /* cursor inherited from global rocket rule */
    opacity: 1;
    transition: opacity 0.3s ease, top 0.5s ease;
    z-index: 1000;
}

.adsense-footer.collapsed .adsense-footer-grabber {
    top: 2px;
    opacity: 1;
}

.adsense-footer-grabber:hover {
    background: var(--text-secondary);
    opacity: 1;
}

/* Ad container */
.adsense-footer-ad {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
}

/* AdSense responsive ad */
.adsense-footer ins {
    display: block;
    text-align: center;
}

/* Ensure body has margin for sticky footer */
body {
    padding-bottom: 100px;
}

body.adsense-footer-hidden {
    padding-bottom: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .adsense-footer {
        padding: 8px 15px;
        min-height: 80px;
        max-height: 280px;
    }
    
    .adsense-footer.collapsed {
        min-height: 20px;
    }
    
    .footer-branding h3 {
        font-size: 13px;
    }
    
    .footer-branding p {
        font-size: 11px;
    }
    
    .footer-links {
        font-size: 11px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .gamePhase.hidden {
        display: none !important;
    }
}
