@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Kanit', sans-serif;
    background-color: #f7f9fa;
    color: #202124;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background: #ffffff;
    padding: 36px 30px;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.02);
    text-align: center;
    max-width: 420px;
    width: 92%;
    position: relative;
}

/* Screen visibility */
.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   Start Screen
   ======================================================== */
.logo-badge {
    width: 60px;
    height: 60px;
    background: #e8f0fe;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
}

.main-title {
    font-size: 1.85rem;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.subtitle {
    color: #757575;
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.rules-card {
    background: #f8f9fa;
    border: 1px solid #eef0f2;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
}

.rules-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #3c4043;
    margin-bottom: 12px;
}

.rules-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rules-card li {
    font-size: 0.92rem;
    color: #5f6368;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

/* Start / Primary Button */
.btn-start {
    width: 100%;
    background: #1a73e8 !important;
    color: #ffffff !important;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 600;
    padding: 15px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(26, 115, 232, 0.35);
    transition: all 0.2s ease;
    display: block;
    outline: none;
}

.btn-start:hover {
    background: #1557b0 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.45);
}

.btn-start:active {
    transform: translateY(1px);
}

/* ========================================================
   Game Screen
   ======================================================== */
.game-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #dadce0;
    color: #5f6368;
    font-family: inherit;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f1f3f4;
    color: #202124;
    border-color: #c4c7c5;
}

.game-status-badges {
    display: flex;
    gap: 8px;
    align-items: center;
}

.question-badge {
    font-size: 0.85rem;
    font-weight: 600;
    color: #3c4043;
    background: #f1f3f4;
    padding: 5px 12px;
    border-radius: 20px;
}

.score-badge {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a73e8;
    background: #e8f0fe;
    padding: 5px 12px;
    border-radius: 20px;
}

header h1 {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 16px;
    color: #1a1a1a;
}

/* Timer styles */
.timer-container {
    margin-bottom: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #5f6368;
    background: #f1f3f4;
    padding: 6px 16px;
    border-radius: 20px;
    transition: color 0.3s, background-color 0.3s;
}

.timer-badge.warning {
    color: #d93025;
    background: #fce8e6;
    animation: pulse 1s infinite;
}

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

.timer-icon {
    display: inline-block;
}

.timer-bar-wrapper {
    width: 100%;
    height: 4px;
    background: #e8eaed;
    border-radius: 2px;
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    width: 100%;
    background: #1a73e8;
    border-radius: 2px;
    transition: width 0.1s linear, background-color 0.3s;
}

.timer-bar.warning {
    background: #d93025;
}

/* Question Card */
.card {
    border: 1px solid #efefef;
    border-radius: 14px;
    padding: 32px 20px;
    margin-bottom: 24px;
    position: relative;
    background: #fafafa;
    transition: border-color 0.3s;
}

.label {
    display: block;
    font-size: 0.8rem;
    color: #9e9e9e;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 14px;
}

#propositionText {
    font-size: 3rem;
    font-weight: 400;
    letter-spacing: 2px;
    color: #202124;
}

.feedback {
    margin-top: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    min-height: 22px;
    transition: opacity 0.2s ease-in-out;
}

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

.feedback.correct {
    color: #2e7d32;
}

.feedback.incorrect {
    color: #d32f2f;
}

.feedback.timeout {
    color: #e65100;
}

/* Game Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.btn {
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 500;
    padding: 13px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.btn-true, .btn-false {
    flex: 1;
    background: #ffffff;
}

.btn-true {
    border: 1.5px solid #a5d6a7;
    color: #2e7d32;
}

.btn-true:hover:not(:disabled) {
    background: #f1f8e9;
    border-color: #81c784;
}

.btn-false {
    border: 1.5px solid #ef9a9a;
    color: #d32f2f;
}

.btn-false:hover:not(:disabled) {
    background: #ffebee;
    border-color: #e57373;
}

.btn-next {
    width: 100%;
    border: 1.5px solid #e0e0e0;
    color: #3c4043;
    background: #f8f9fa;
    font-weight: 600;
}

.btn-next:hover {
    background: #eeeeee;
    border-color: #bdbdbd;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========================================================
   Result Screen
   ======================================================== */
.result-icon-wrapper {
    width: 72px;
    height: 72px;
    background: #fef7e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
}

.result-emoji {
    font-size: 2.5rem;
}

.score-card {
    background: #f8f9fa;
    border: 1px solid #eef0f2;
    border-radius: 16px;
    padding: 24px 20px;
    margin-bottom: 24px;
}

.score-label {
    display: block;
    font-size: 0.85rem;
    color: #757575;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.final-score {
    font-size: 3.2rem;
    font-weight: 700;
    color: #1a73e8;
    line-height: 1.1;
    margin-bottom: 18px;
}

.final-score small {
    font-size: 1.2rem;
    color: #9aa0a6;
    font-weight: 400;
}

.score-breakdown {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid #eef0f2;
    padding-top: 14px;
}

.breakdown-item {
    font-size: 0.9rem;
    color: #5f6368;
    display: flex;
    align-items: center;
    gap: 6px;
}

.breakdown-item.correct-count strong {
    color: #2e7d32;
}

.breakdown-item.wrong-count strong {
    color: #d32f2f;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-secondary {
    width: 100%;
    background: #ffffff;
    border: 1.5px solid #dadce0;
    color: #3c4043;
    font-weight: 500;
}

.btn-secondary:hover {
    background: #f1f3f4;
    border-color: #c4c7c5;
}
