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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: transparent;
    border-radius: 20px;
    max-width: 720px;
    width: 100%;
    padding: 40px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.title {
    color: #9B59B6;
    text-align: center;
    font-size: 3em;
    margin-bottom: 10px;
}

.subtitle {
    color: #5C9BD1;
    text-align: center;
    font-size: 1.5em;
    margin-bottom: 30px;
}

.rules-container {
    margin-bottom: 30px;
    color: #34495E;
}

.rules-container h2 {
    color: #3498DB;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.rules-container h3 {
    color: #E67E22;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.rules-list {
    list-style: none;
    padding-left: 20px;
}

.rules-list li {
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
    line-height: 1.6;
}

.rules-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #E74C3C;
    font-size: 1.5em;
    line-height: 0.8;
}

.mode-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.mode-btn {
    background: #BDC3C7;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #34495E;
}

.mode-btn:hover {
    background: #95A5A6;
    transform: translateY(-2px);
}

.mode-btn.selected {
    background: #5C9BD1;
    color: white;
}

.start-btn {
    background: #27AE60;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 15px;
    font-size: 1.2em;
    cursor: pointer;
    display: block;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.start-btn:hover:not(:disabled) {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

.start-btn:disabled {
    background: #BDC3C7;
    cursor: not-allowed;
    opacity: 0.6;
}

.game-header {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    padding: 15px;
    background: transparent;
    position: relative;
}

.game-header #timer {
    position: absolute;
    right: 40px;
}

.timer-container {
    width: 60px;
    height: 60px;
}

.timer-circle {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-circle-bg {
    fill: none;
    stroke: #E8E8E8;
    stroke-width: 8;
}

.timer-circle-progress {
    fill: none;
    stroke: #E74C3C;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339.292; /* 2 * PI * 54 */
    stroke-dashoffset: 0;
}

.timer-circle-progress.animated {
    transition: stroke-dashoffset 1s linear;
}

.timer-circle-progress.warning {
    animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% {
        stroke: #E74C3C;
    }
    50% {
        stroke: #FF6B6B;
    }
}

.score {
    font-size: 3em;
    font-weight: bold;
    color: #27AE60;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.2);
}

.score-updated {
    animation: scorePop 0.5s ease;
}

@keyframes scorePop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
        color: #229954;
    }
    100% {
        transform: scale(1);
    }
}

.word-card {
    background: transparent;
    border-radius: 20px;
    padding: 50px;
    margin-bottom: 30px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.word-card:hover {
    opacity: 0.8;
}

.word-display {
    display: block;
    font-size: 12em;
    color: #2C3E50;
    text-align: center;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.buttons-container {
    display: flex;
    gap: 20px;
    justify-content: center;
}
.answer-btn {
    flex: 1;
    padding: 20px;
    border: none;
    border-radius: 15px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-weight: bold;
}

#hraswa-btn {
    background: #E74C3C;
}

#hraswa-btn:hover {
    background: #C0392B;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

#dirgha-btn {
    background: #3498DB;
}

#dirgha-btn:hover {
    background: #2980B9;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.final-score {
    text-align: center;
}

.final-score p {
    font-size: 2em;
    color: #34495E;
    margin-bottom: 30px;
}

.final-score #final-score {
    color: #E74C3C;
    font-size: 1.2em;
}

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

.word-appear {
    animation: wordFadeIn 0.6s ease;
}

@media (max-width: 768px) {
    .title {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 1.2em;
    }
    
    .word-display {
        font-size: clamp(2.5rem, 16vw, 5.5rem);
    }
    
    .answer-btn {
        font-size: 1.2em;
        padding: 15px;
    }
    
    .buttons-container {
        flex-direction: column;
    }
}

/* Teacher image placed outside the main game window */
.teacher-outside {
    position: absolute;
    /* move closer to center (less extreme right) */
    right: 120px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none; /* don't block clicks on smaller viewports */
}

.teacher-outside img {
    width: 220px; /* slightly bigger */
    max-width: 26vw;
    height: auto;
    display: block;
    /* remove box/outline */
    box-shadow: none;
    border-radius: 0;
    border: 0;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.teacher-outside img.react {
    transform: scale(1.05);
}

@media (max-width: 1100px) {
    /* hide outside image on small screens so it doesn't overlap */
    .teacher-outside { display: none; }
}

