* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --cheese-yellow: #ffcc33;
    --cheese-dark: #e6a800;
    --cheese-hole: #8b6508;
    --accent-orange: #ff6b35;
    --accent-red: #e63946;
    --text-dark: #2d1f0c;
    --text-light: #fff8e7;
    --shadow: rgba(45, 31, 12, 0.3);
}

body {
    font-family: 'Fredoka', sans-serif;
    overflow: hidden;
    background: var(--cheese-dark);
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* UI Overlay */
#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    pointer-events: none;
    z-index: 10;
}

#score-panel {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.stat {
    background: linear-gradient(135deg, var(--cheese-yellow) 0%, var(--cheese-dark) 100%);
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 15px var(--shadow), inset 0 2px 0 rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    border: 3px solid var(--cheese-hole);
}

.stat .label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cheese-hole);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat span:last-child {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(45, 31, 12, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.screen-content {
    text-align: center;
    padding: 3rem;
    background: linear-gradient(145deg, var(--cheese-yellow) 0%, var(--cheese-dark) 100%);
    border-radius: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), inset 0 4px 0 rgba(255, 255, 255, 0.3);
    border: 4px solid var(--cheese-hole);
    max-width: 90vw;
    animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.screen-content h1 {
    font-size: 3rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.3);
}

.screen-content p {
    font-size: 1.25rem;
    color: var(--cheese-hole);
    margin-bottom: 2rem;
    font-weight: 500;
}

.game-btn {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 1rem 3rem;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-red) 100%);
    color: var(--text-light);
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.game-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(230, 57, 70, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.game-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.4);
}

/* Prey Selector */
.prey-selector {
    margin: 1.5rem 0;
}

.selector-label {
    font-size: 1rem !important;
    margin-bottom: 1rem !important;
}

.prey-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    max-width: 400px;
    margin: 0 auto;
}

.prey-option {
    font-family: 'Fredoka', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border: 3px solid var(--cheese-hole);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.prey-option:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.prey-option.selected {
    background: rgba(255, 107, 53, 0.3);
    border-color: var(--accent-orange);
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.4);
}

.prey-emoji {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.prey-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.prey-diff {
    font-size: 0.75rem;
    color: var(--cheese-hole);
    font-weight: 500;
}

/* Settings Row */
.settings-row {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.setting-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.setting-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cheese-hole);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.setting-options {
    display: flex;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.1);
    padding: 0.25rem;
    border-radius: 0.5rem;
}

.setting-btn {
    font-family: 'Fredoka', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.4rem 0.7rem;
    border: none;
    border-radius: 0.4rem;
    background: transparent;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.15s ease;
}

.setting-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.setting-btn.selected {
    background: var(--accent-orange);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
}

/* Catch Feedback */
#catch-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: 700;
    color: var(--accent-orange);
    text-shadow: 3px 3px 0 var(--text-dark), -1px -1px 0 var(--text-dark);
    pointer-events: none;
    z-index: 50;
    animation: catchPop 0.6s ease-out forwards;
}

#catch-feedback.hidden {
    display: none;
}

@keyframes catchPop {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.3);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -100%) scale(1);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .screen-content h1 {
        font-size: 2rem;
    }
    
    .screen-content p {
        font-size: 1rem;
    }
    
    .game-btn {
        font-size: 1.25rem;
        padding: 0.875rem 2rem;
    }
    
    .stat {
        min-width: 80px;
        padding: 0.5rem 1rem;
    }
    
    .stat span:last-child {
        font-size: 1.5rem;
    }
    
    #score-panel {
        gap: 1rem;
    }
}

@media (max-width: 400px) {
    .screen-content {
        padding: 2rem;
    }

    .screen-content h1 {
        font-size: 1.75rem;
    }
}

/* Record Button */
.record-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    transition: all 0.2s ease;
    z-index: 20;
}

.record-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.record-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e63946;
    transition: all 0.2s ease;
}

.record-btn.recording {
    border-color: #e63946;
    animation: recordPulse 1.5s ease-in-out infinite;
}

.record-btn.recording .record-dot {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background: #e63946;
}

@keyframes recordPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.5);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(230, 57, 70, 0);
    }
}

/* Share Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(145deg, var(--cheese-yellow) 0%, var(--cheese-dark) 100%);
    border-radius: 1.5rem;
    padding: 2rem;
    max-width: 90vw;
    max-height: 90vh;
    width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 4px solid var(--cheese-hole);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-content h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 1rem;
}

.close-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: scale(1.1);
}

.video-preview {
    background: #000;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1rem;
    aspect-ratio: 16/9;
}

.video-preview video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.share-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.share-btn {
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.share-btn.download {
    background: var(--text-dark);
    color: white;
}

.share-btn.download:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
}

.share-btn.share {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.share-btn.share:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4);
}

.btn-icon {
    font-size: 1.2rem;
}

.share-tip {
    font-size: 0.85rem;
    color: var(--cheese-hole);
    text-align: center;
    margin: 0;
}

/* Mobile adjustments for modal */
@media (max-width: 600px) {
    .modal-content {
        padding: 1.5rem;
        width: calc(100vw - 2rem);
    }

    .modal-content h2 {
        font-size: 1.25rem;
    }

    .share-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Help Mode Toggle - Cat Psychology feature */
.help-mode-row {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
}

.help-mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 1rem;
    transition: background 0.2s ease;
}

.help-mode-toggle:hover {
    background: rgba(0, 0, 0, 0.15);
}

.help-mode-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 48px;
    height: 26px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 13px;
    position: relative;
    transition: background 0.3s ease;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.help-mode-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: var(--accent-orange);
}

.help-mode-toggle input[type="checkbox"]:checked + .toggle-slider::after {
    transform: translateX(22px);
}

.toggle-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.toggle-info {
    font-size: 0.75rem;
    color: var(--cheese-hole);
    max-width: 180px;
    line-height: 1.3;
}

@media (max-width: 500px) {
    .help-mode-toggle {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .toggle-info {
        flex-basis: 100%;
        max-width: none;
        margin-top: 0.5rem;
    }
}

