/**
 * Regular Game Mode
 * Styles for the regular game mode including timer, feedback, and results
 */

/* ===================================== */
/* PRACTICE MODE BANNER                  */
/* ===================================== */

.practice-header h2 {
    color: #2d2748;
    margin: 0 0 15px 0;
}

.practice-description {
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: left;
    color: var(--text-secondary);
}

/* Dark mode */
body.dark-mode .practice-header h2 {
    color: #ffffff;
}

/* ===================================== */
/* GAME PAGE LAYOUT                      */
/* ===================================== */

#game-page {
    flex: 1;
    /* Take remaining space in game-container */
    min-height: 0;
    /* Allow flexbox to shrink below content size */
    overflow: visible;
    /* Allow scrolling when zoomed */
}

/* Game input section - fixed size */
#game-page .section:nth-child(1) {
    flex-shrink: 0;
    /* Don't shrink input section */
    flex-grow: 0;
    /* Don't grow */
}

/* Guess history section - fills remaining space and scrolls internally */
#game-page .section:nth-child(2) {
    display: flex;
    flex-direction: column;
    background: rgba(243, 156, 18, 0.03);
    border: 1px solid rgba(13, 148, 136, 0.15);
    flex: 1;
    /* Take all remaining space */
    min-height: 150px;
    /* Reduced to ensure quit button fits */
    overflow: hidden;
}

#game-page .section:nth-child(2) h2 {
    margin-bottom: 15px;
    font-size: 1.1em;
    color: var(--primary-color);
    flex-shrink: 0;
}

#game-page .section:nth-child(2) #guess-history {
    flex: 1;
    min-height: 0;
    /* IMPORTANT: Allow flex to constrain height */
    overflow-y: auto;
    overflow-x: hidden;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(13, 148, 136, 0.1);
    border-radius: 10px;
    padding: 10px;
}

/* Custom scrollbar for guess history */
#game-page .section:nth-child(2) #guess-history::-webkit-scrollbar {
    width: 8px;
}

#game-page .section:nth-child(2) #guess-history::-webkit-scrollbar-track {
    background: rgba(13, 148, 136, 0.1);
    border-radius: 4px;
}

#game-page .section:nth-child(2) #guess-history::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-color-rgb), 0.4);
    border-radius: 4px;
}

#game-page .section:nth-child(2) #guess-history::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--primary-color-rgb), 0.6);
}

body.dark-mode #game-page .section:nth-child(2) #guess-history {
    background: rgba(0, 0, 0, 0.2);
}

body.dark-mode #game-page .section:nth-child(2) #guess-history::-webkit-scrollbar-thumb {
    background: rgba(96, 197, 242, 0.3);
}

body.dark-mode #game-page .section:nth-child(2) #guess-history::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 197, 242, 0.5);
}

/* Dark mode enhancements */
body.dark-mode #game-page .section:nth-child(1) {
    background: rgba(13, 148, 136, 0.08);
    border: 2px solid rgba(13, 148, 136, 0.3);
}

body.dark-mode #game-page .section:nth-child(2) {
    background: rgba(243, 156, 18, 0.06);
    border: 1px solid rgba(13, 148, 136, 0.25);
}

/* Submit and quit buttons */
#game-page #submit-guess {
    margin-top: 20px;
    font-size: 1.1em;
    padding: 15px 30px;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
    transition: all 0.3s ease;
}

#game-page #submit-guess:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(13, 148, 136, 0.4);
}

#game-page #submit-guess:active {
    transform: translateY(0);
}

#game-page button#quit-game {
    margin-top: 8px;
    margin-bottom: 0;
    flex-shrink: 0;
    /* Don't let it shrink */
    flex-grow: 0;
    /* Don't let it grow */
}

/* ===================================== */
/* TIMER (SVG Circular Progress)         */
/* ===================================== */

#timer-container {
    width: 100px;
    height: 100px;
    position: relative;
    margin: 20px auto;
}

.timer-svg {
    transform: rotate(-90deg);
}

.timer-background {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 8;
}

.timer-progress {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s ease;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
}

/* ===================================== */
/* FEEDBACK MESSAGES                     */
/* ===================================== */

#feedback {
    margin-top: 20px;
    padding: 15px 25px;
    border-radius: 25px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    animation: bounceIn 0.5s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#feedback.success {
    background: rgba(82, 201, 140, 0.15);
    color: #3d8e63;
    border: 2px solid rgba(82, 201, 140, 0.4);
}

#feedback.error {
    background: rgba(239, 111, 111, 0.15);
    color: #c94f4f;
    border: 2px solid rgba(239, 111, 111, 0.4);
}

#feedback.info {
    background: rgba(78, 168, 222, 0.15);
    color: #3a7aa8;
    border: 2px solid rgba(78, 168, 222, 0.4);
}

/* ===================================== */
/* SECTIONS SLIDE-IN                     */
/* ===================================== */

.section {
    animation: slideInUp 0.6s ease backwards;
}

/* ===================================== */
/* RESPONSIVE GAME MODE                  */
/* ===================================== */

@media screen and (max-width: 768px) {
    #timer-container {
        width: 80px;
        height: 80px;
    }

    #timer-progress {
        font-size: 18px;
    }
}

@media screen and (max-width: 480px) {
    #timer-container {
        width: 70px;
        height: 70px;
    }

    #timer-progress {
        font-size: 16px;
    }
}