body {
    font-family: 'Verdana', 'Geneva', sans-serif;
    font-weight: 700;
    color: #333333;
    background-color: #A3B18A;
    background-image: none;
    text-align: center;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

body.phase1-background {
    transition: background-color 1.8s ease, background-image 1.8s ease;
}
h1 {
    color: #333333;
    margin-bottom: 30px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
    background-color: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: 15px;
    display: inline-block;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    font-weight: bold !important;
    font-style: normal !important;
    font-family: 'Verdana', 'Geneva', sans-serif !important;
}
.app-container {
    display: flex;
    flex-direction: column;
    max-width: 1000px;
    margin: 0 auto;
    gap: 20px;
}

.game-container {
    width: 100%;
    padding: 10px;
}

.current-word {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    margin: 20px 0;
    background-color: #fff;
    padding: 15px;
    border-radius: 15px;
    border: 4px solid #ff6b6b;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: inline-block;
    min-width: 200px;
    transition: all 0.3s ease;
}

.spelling-game {
    margin: 16px auto 0;
    padding: 12px 16px;
    border: 3px dashed #ff6b6b;
    border-radius: 14px;
    background: #fff;
    max-width: 520px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.spelling-prompt {
    font-size: 18px;
    font-weight: bold;
    color: #ff6b6b;
}

.spelling-options {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 12px;
}

.spelling-option {
    font-size: 24px;
    font-weight: bold;
    padding: 12px;
    border-radius: 12px;
    border: 3px solid #4CAF50;
    background: #e8fff1;
    color: #2e2e2e;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.spelling-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.12);
}

.spelling-option.wrong {
    border-color: #ccc;
    background: #f7f7f7;
    color: #777;
    text-decoration: line-through;
    cursor: default;
    box-shadow: none;
}

.spelling-option.correct {
    border-color: #2e7d32;
    background: #d7f7dc;
}

.focus-game {
    position: relative;
    width: 100%;
    height: 380px;
    margin: 10px auto 20px;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
}

.focus-image {
    max-width: 240px;
    max-height: 240px;
    object-fit: contain;
    border: 4px solid #ff6b6b;
    border-radius: 16px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.focus-image.wiggle {
    animation: focusWiggle 0.45s ease-in-out;
}

@keyframes focusWiggle {
    0% { transform: rotate(0deg) scale(1); }
    20% { transform: rotate(-4deg) scale(1.02); }
    45% { transform: rotate(4deg) scale(1.03); }
    70% { transform: rotate(-3deg) scale(1.01); }
    100% { transform: rotate(0deg) scale(1); }
}

.floating-word {
    position: absolute;
    left: 20px;
    top: 20px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 3px solid #c2c199;
    background: #FDFDD0;
    font-size: 36px;
    font-weight: 700;
    font-family: 'Verdana', 'Geneva', sans-serif;
    color: #333333;
    transition: left 1.4s ease-in-out, top 1.4s ease-in-out, transform 1.4s ease-in-out, background-color 0.6s ease, color 0.6s ease, font-size 0.6s ease;
    pointer-events: none;
    text-align: center;
    min-width: 120px;
}

.phase1-typing-input-wrap {
    display: flex;
    width: 100%;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.2s;
    pointer-events: auto;
}

.phase1-typing-input-wrap.hidden-input {
    opacity: 0;
    pointer-events: none;
    position: absolute; /* Keep it in layout but out of flow if needed, or just hidden */
    z-index: -1;
}

.phase1-typing-input {
    width: min(360px, 80%);
    padding: 10px 14px;
    font-size: clamp(22px, 5vw, 32px);
    font-weight: 700;
    font-family: 'Verdana', 'Geneva', sans-serif;
    color: #333333;
    background: #FDFDD0;
    border: 3px solid #c2c199;
    border-radius: 12px;
    text-align: center;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.floating-word.typing-word {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    padding: 0;
    min-width: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    font-size: clamp(56px, 12vw, 96px);
    font-weight: 700;
    letter-spacing: 4px;
    color: #333333;
    opacity: 1;
    transition: none;
    text-shadow: none;
    font-family: 'Verdana', 'Geneva', sans-serif;
}

.floating-word.blink {
    animation: floatingBlink 0.4s steps(2) infinite;
}

@keyframes floatingBlink {
    50% { opacity: 0; }
}

.chase-game {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin: 10px auto 20px;
}

.chase-hud {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    background: #FDFDD0;
    border: 2px solid #c2c199;
    border-radius: 14px;
    padding: 10px 16px;
}

.chase-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 12px;
    border: 3px solid #c2c199;
    background: #ffffff;
    padding: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.chase-word {
    font-size: clamp(24px, 5vw, 34px);
    font-weight: 700;
    color: #333333;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
}

.chase-word .target {
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 6px;
    color: #2f4f2f;
}

.chase-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333333;
}

.chase-label {
    font-weight: 700;
}

.chase-grid-size-value {
    min-width: 52px;
    font-weight: 700;
}

.chase-board {
    position: relative;
    width: min(80vw, 420px);
    aspect-ratio: 1 / 1;
    background-color: #fefef0;
    border: 3px solid #5f6f52;
    border-radius: 12px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
    overflow: hidden;
    --cell-size: 48px;
    background-image:
        linear-gradient(#d8d8c8 1px, transparent 1px),
        linear-gradient(90deg, #d8d8c8 1px, transparent 1px);
    background-size: var(--cell-size) var(--cell-size);
}

.chase-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.chase-reset-btn {
    background: #ff7043;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.chase-reset-btn:hover {
    background: #f4511e;
}

.chase-pad {
    display: grid;
    grid-template-columns: repeat(3, minmax(44px, 54px));
    grid-template-rows: repeat(3, minmax(44px, 54px));
    gap: 8px;
    align-items: center;
    justify-items: center;
    padding: 6px;
    background: #FDFDD0;
    border: 2px solid #c2c199;
    border-radius: 16px;
}

.chase-pad-btn {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
    background: #5f6f52;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}

.chase-pad-btn:hover {
    background: #4f5d45;
}

.chase-pad-btn[data-dir="up"] { grid-column: 2; grid-row: 1; }
.chase-pad-btn[data-dir="left"] { grid-column: 1; grid-row: 2; }
.chase-pad-btn[data-dir="down"] { grid-column: 2; grid-row: 3; }
.chase-pad-btn[data-dir="right"] { grid-column: 3; grid-row: 2; }

.chase-letter {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--cell-size);
    height: var(--cell-size);
    font-size: clamp(18px, 4vw, 28px);
    font-weight: 700;
    color: #2c2c2c;
    background: #ffffff;
    border: 2px solid #c2c199;
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.12);
    transition: left 0.35s ease, top 0.35s ease;
    z-index: 2;
}

.chase-obstacle {
    position: absolute;
    width: var(--cell-size);
    height: var(--cell-size);
    background: #8d8b7d;
    border: 2px solid #6e6c60;
    border-radius: 6px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1;
}

.chase-player {
    position: absolute;
    width: var(--cell-size);
    height: var(--cell-size);
    transition: left 0.2s ease, top 0.2s ease;
    pointer-events: none;
    z-index: 3;
}

@media (max-width: 768px) {
    .chase-board {
        width: min(96vw, 520px);
    }

    .chase-image {
        width: 140px;
        height: 140px;
    }

    .chase-pad {
        grid-template-columns: repeat(3, minmax(72px, 96px));
        grid-template-rows: repeat(3, minmax(72px, 96px));
    }

    .chase-pad-btn {
        font-size: 28px;
    }
}

.match-game {
    margin: 16px auto 0;
    padding: 12px 16px 18px;
    border: 3px dashed #4CAF50;
    border-radius: 14px;
    background: #fff;
    max-width: 800px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.match-scroll {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
}

.match-check-btn {
    display: block;
    margin: 12px auto 0;
    background: #4CAF50;
}

.match-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.match-row {
    display: grid;
    grid-template-columns: minmax(120px, 160px) 1fr;
    align-items: center;
    gap: 12px;
}

.match-image {
    height: 90px;
    background: #f5f9ff;
    border: 2px solid #dbe7ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    cursor: default;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.match-row.selected .match-image {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.25);
}

.match-row.selected .match-word {
    border-color: #d84315;
    box-shadow: 0 0 0 4px rgba(216, 67, 21, 0.45);
    background: #ffb84d;
    color: #1f1f1f;
    font-weight: bold;
}

.match-row.matched .match-image {
    border-color: #2e7d32;
    background: #d7f7dc;
    cursor: default;
    pointer-events: none;
}

.match-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.match-word {
    font-size: 22px;
    font-weight: bold;
    padding: 10px 14px;
    border-radius: 12px;
    border: 3px solid #ff6b6b;
    background: #ffeef0;
    cursor: pointer;
    user-select: none;
}

.match-row.matched .match-word {
    border-color: #2e7d32;
    background: #c8f0d3;
    cursor: default;
}

/* Group info styling */
.group-info {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    background-color: #9fe5c5;
    padding: 8px 25px;
    border-radius: 15px;
    margin: 10px auto 20px auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: inline-block;
    transition: all 0.3s ease;
    border: 3px solid #4CAF50;
}

/* Tracing container styles */
.tracing-container {
    width: 100%;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 10px;
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    touch-action: none; /* Prevent browser scrolling on touch devices */
}

.tracing-canvas {
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 3px dashed #adb5bd;
    margin-bottom: 15px;
    cursor: pointer;
    touch-action: none;
}

.tracing-instructions {
    font-size: 18px;
    margin-bottom: 10px;
    color: #4361ee;
}

.connection-dot {
    transition: fill 0.2s ease;
    stroke: #333;
    stroke-width: 1;
    cursor: pointer;
}

.connection-dot:hover {
    fill: #FFA500;
    r: 12;
}

.trace-letter-highlight {
    animation: letterPulse 1.5s infinite;
}

@keyframes letterPulse {
    0% { stroke-width: 6; }
    50% { stroke-width: 10; }
    100% { stroke-width: 6; }
}

@keyframes dotPulse {
    0% { r: 8; }
    50% { r: 14; }
    100% { r: 8; }
}

.pulse-dot {
    animation: dotPulse 1.5s infinite;
}

.completion-message {
    font-size: 28px;
    font-weight: bold;
    color: #4CAF50;
    background-color: #d4edda;
    padding: 15px 25px;
    border-radius: 10px;
    margin: 15px 0;
    animation: popIn 0.5s ease-out;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.letter-feedback {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    z-index: 100;
    pointer-events: none;
}

@keyframes feedbackFadeUp {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-20px); opacity: 0; }
}

.tracing-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.clear-button {
    background-color: #6c757d;
    margin-top: 10px;
}

.demo-button {
    background-color: #17a2b8;
    margin-right: 10px;
}

.speech-button {
    background-color: #fd7e14;
}

.mic-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 24px;
    color: #dc3545;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes correctAnswer {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.correct-answer {
    animation: correctAnswer 0.5s ease-in-out;
    background-color: #d4ffea;
}

.hint-image {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
    margin: 10px auto;
    display: none;
}

.hint-image.large-hint {
    max-width: 260px;
    max-height: 260px;
}

.cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}
.card {
    width: 150px;
    height: 200px;
    perspective: 1000px;
    cursor: pointer;
}
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border-radius: 15px;
    border: 3px solid transparent;
}

.card:hover .card-inner {
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
    border-color: #ffcc00;
}
.card.flipped .card-inner {
    transform: rotateY(180deg);
}
.card.phase3-complete .card-inner {
    border-color: #4CAF50;
}
.card.phase3-complete {
    cursor: default;
    pointer-events: none;
}
.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.card-front {
    background-color: #fff;
    color: black;
}
.card-back {
    background-color: #fff;
    color: black;
    transform: rotateY(180deg);
}
.card-image {
    width: 90%;
    height: 90%;
    object-fit: contain;
    cursor: pointer;
}

.card-image-png {
    transform: scale(1.08);
    transform-origin: center;
}
.card-word {
    font-size: 28px;
    font-weight: bold;
}
.controls {
    margin: 20px 0;
}
button {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#replay-button {
    background-color: #2196F3;
    display: none;
}
.message-box {
    font-size: 24px;
    margin: 20px;
    padding: 15px;
    border-radius: 10px;
    background-color: #fdfd96;
    display: none;
}
.correct {
    background-color: #b5ead7;
}
.wrong {
    background-color: #ffb7b2;
}

/* Animation for group transition */
@keyframes groupTransition {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.group-transition {
    animation: groupTransition 1s ease-in-out;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    /* Basic layout adjustments */
    body {
        padding: 10px;
        padding-bottom: 40px; /* Extra space for copyright notice */
    }
    
    h1 {
        font-size: 24px !important;
        margin-bottom: 15px;
        font-style: normal !important;
        font-weight: bold !important;
        color: #d30000 !important; /* Darker red for better contrast */
        text-shadow: 1px 1px 2px rgba(0,0,0,0.2) !important;
        background-color: rgba(255, 255, 255, 0.85) !important; /* Slightly more opaque background */
    }
    
    .app-container {
        padding: 0;
        margin-bottom: 40px;
    }
    
    /* Group info styling */
    .group-info {
        font-size: 18px;
        padding: 5px 15px;
    }
    
    /* Navigation adjustments */
    .main-nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-nav a, .main-nav button {
        margin: 5px;
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .group-info-nav {
        width: 100%;
        text-align: center;
        padding: 5px !important;
        order: -1;
        background-color: #f0f8ff;
        border-radius: 5px;
        margin-bottom: 5px;
    }
    
    /* Card adjustments */
    .card {
        width: 90px;
        height: 130px;
    }
    
    .card-word {
        font-size: 18px;
    }
    
    .current-word {
        font-size: 22px;
        min-width: 120px;
        padding: 5px;
        margin: 5px 0;
    }

    .focus-game {
        height: 300px;
    }

    .focus-image {
        max-width: 180px;
        max-height: 180px;
    }

    .floating-word {
        font-size: 24px;
        padding: 8px 12px;
    }

    .hint-image.large-hint {
        max-width: 180px;
        max-height: 180px;
    }

    .match-game {
        padding: 10px 12px 14px;
    }

    .match-scroll {
        max-height: 320px;
    }

    .match-row {
        grid-template-columns: 90px 1fr;
        gap: 10px;
    }

    .match-image {
        height: 70px;
    }

    .match-word {
        font-size: 18px;
        padding: 8px 10px;
    }
    
    /* Message box styling */
    .message-box {
        font-size: 14px;
        padding: 5px;
        margin: 5px;
    }
    
    /* Tracing enhancements for mobile */
    .tracing-instructions {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .tracing-container {
        padding: 5px;
    }
    
    .tracing-canvas {
        margin-bottom: 0;
        height: auto !important;
        min-height: 350px !important;
    }
    
    /* Adjust traceable letters size on mobile */
    .letter-group path {
        stroke-width: 12 !important; /* Thicker lines for larger letters */
    }
    
    .connection-dot {
        r: 18 !important; /* Much bigger dots to match larger letters */
    }
    
    /* Button styling */
    button {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .tracing-button {
        padding: 6px 10px;
        font-size: 14px;
        min-width: 80px;
    }
    
    .tracing-buttons-container {
        gap: 5px;
    }
    
    .sound-toggle-btn {
        padding: 3px 10px;
        font-size: 12px;
        right: 60px;
        top: 5px;
    }
    
    /* Copyright */
    .copyright-notice {
        font-size: 12px;
        padding: 5px 0;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    /* Card adjustments */
    .card {
        width: 75px;
        height: 110px;
    }
    
    .card-word {
        font-size: 16px;
    }

    .focus-game {
        height: 260px;
    }

    .focus-image {
        max-width: 150px;
        max-height: 150px;
    }

    .floating-word {
        font-size: 20px;
        padding: 6px 10px;
    }

    .hint-image.large-hint {
        max-width: 140px;
        max-height: 140px;
    }

    .match-row {
        grid-template-columns: 70px 1fr;
    }

    .match-scroll {
        max-height: 260px;
    }

    .match-image {
        height: 60px;
    }

    .match-word {
        font-size: 16px;
    }
    
    /* Typography */
    h1 {
        font-size: 18px !important; /* Slightly larger for better readability */
    }
    
    /* Button styling */
    button {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .tracing-button {
        padding: 5px 8px;
        font-size: 12px;
        min-width: 70px;
    }
    
    .sound-toggle-btn {
        padding: 2px 8px;
        font-size: 10px;
        right: 50px;
    }
    
    /* Make letters even bigger on very small screens */
    .tracing-canvas {
        min-height: 400px !important;
    }
    
    .letter-group path {
        stroke-width: 14 !important; /* Even thicker lines */
    }
    
    .connection-dot {
        r: 22 !important; /* Even bigger dots for improved touch targets */
    }
}

.copyright-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 8px 0;
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    color: #666;
    z-index: 100;
    border-top: 1px solid #eee;
}

/* Add styling for the tracing buttons */
.tracing-buttons-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
    width: 100%;
    flex-wrap: wrap;
}

.tracing-button {
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    flex: 1;
    min-width: 100px;
    max-width: 160px;
}

.tracing-button:hover {
    background-color: #3e8e41;
}

.clear-button {
    background-color: #f44336;
}

.clear-button:hover {
    background-color: #d32f2f;
}

.next-word-button {
    background-color: #2196f3;
}

.next-word-button:hover {
    background-color: #1976d2;
}

.play-sound-button {
    background-color: #ff9800;
}

.play-sound-button:hover {
    background-color: #f57c00;
}

/* Sound toggle button */
.sound-toggle-btn {
    position: absolute;
    top: 10px;
    right: 80px; /* Position to the left of the group info */
    background-color: #673ab7;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.sound-toggle-btn:hover {
    background-color: #5e35b1;
    transform: translateY(-2px);
}

.sound-toggle-btn.sound-off {
    background-color: #9575cd;
}

/* Main navigation menu */
.main-nav {
    width: 100%;
    background-color: #4CAF50;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 3px 5px rgba(0,0,0,0.2);
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0;
    margin: 0;
}

.main-nav li {
    margin: 0;
    padding: 0;
}

.party-mode-controls {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: -12px auto 14px;
    padding: 8px 14px;
    background: #FDFDD0;
    border: 2px solid #c2c199;
    border-radius: 12px;
    width: fit-content;
    color: #333333;
    font-size: 16px;
}

.party-label {
    font-weight: 700;
    color: #333333;
}

.party-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.party-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.party-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #c8e6c9;
    transition: 0.3s;
    border-radius: 999px;
}

.party-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background-color: #ffffff;
    transition: 0.3s;
    border-radius: 50%;
}

.party-switch input:checked + .party-slider {
    background-color: #ffb300;
}

.party-switch input:checked + .party-slider:before {
    transform: translateX(20px);
}

.group-info-nav {
    margin-left: auto !important;
    padding: 10px 15px !important;
    font-weight: bold;
    color: #2c3e50;
    font-size: 18px;
}

.main-nav a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    font-size: 18px;
    transition: background-color 0.3s;
}

.main-nav a:hover, .main-nav a.active {
    background-color: #3e8e41;
}

.main-nav .sound-toggle-btn {
    position: relative;
    top: 0;
    right: 0;
    background-color: #673ab7;
    color: white;
    border: none;
    border-radius: 0;
    padding: 15px 20px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: none;
    margin: 0;
}

.main-nav .sound-toggle-btn:hover {
    background-color: #5e35b1;
    transform: none;
}

.main-nav .sound-toggle-btn.sound-off {
    background-color: #9575cd;
}

/* Add styles for the contact page */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.contact-form h2 {
    text-align: center;
    color: #4CAF50;
    margin-bottom: 20px;
}

.contact-form p {
    text-align: center;
    margin-bottom: 25px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    font-family: inherit;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.submit-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 18px;
    border-radius: 5px;
    cursor: pointer;
    display: block;
    margin: 0 auto;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #3e8e41;
}

/* Add styles for the upgrade page */
.upgrade-info {
    max-width: 700px;
    margin: 0 auto;
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.upgrade-info h2 {
    text-align: center;
    color: #4CAF50;
    margin-bottom: 20px;
}

.upgrade-info p {
    text-align: center;
    margin-bottom: 25px;
    line-height: 1.5;
}

.benefits-list {
    list-style-type: none;
    padding: 0;
    margin: 25px 0;
}

.benefits-list li {
    padding: 10px 15px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border-left: 4px solid #4CAF50;
    font-size: 16px;
}

.price-tag {
    background-color: #9fe5c5;
    color: #333;
    display: inline-block;
    padding: 8px 15px;
    border-radius: 50px;
    font-weight: bold;
    margin: 15px 0;
}

.sound-toggle-button {
    background-color: #673ab7;
}

.sound-toggle-button:hover {
    background-color: #5e35b1;
}

/* Card Face Down Logic */
.card.face-down {
    opacity: 0.5; /* Fade it out */
    filter: grayscale(100%); /* Turn it gray */
    pointer-events: none; /* Make it unclickable */
    cursor: default;
}

.card.face-down .card-inner {
    background-color: #e0e0e0;
}

.card.face-down .card-image {
    opacity: 0.4;
}

.card.phase1-complete {
    border: 3px solid #ffb300;
    border-radius: 15px;
    pointer-events: none;
}

.card.phase1-complete .card-inner {
    box-shadow: 0 0 0 3px rgba(255, 179, 0, 0.35);
}

.card.phase2-complete {
    border: 3px solid #5f6f52;
    border-radius: 15px;
    pointer-events: none;
}

.card.phase2-complete .card-inner {
    box-shadow: 0 0 0 3px rgba(95, 111, 82, 0.35);
}
/* Styling for completed cards */
.card.flipped.completed-card .card-inner {
    transform: rotateY(180deg); /* Force it to show the back (Text) */
    border: 3px solid #4CAF50; /* Green border to show it's done */
    cursor: default; /* Show arrow, not hand cursor */
}

/* Ensure the text is visible */
.card.flipped.completed-card .card-back {
    background-color: #f0f0f0;
    color: #333;
    font-weight: bold;
}
