:root {
    --success: #00C853;
    --error: #FF5A5F;
}

#app {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ── Start screen ── */
.selection-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.5rem 1rem;
}

/* ── Game screen ── */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
}

#hanzi-target {
    width: 300px;
    height: 300px;
    flex-shrink: 0;
    cursor: crosshair;
    position: relative;
    touch-action: none;
}

.bottom-controls {
    width: 100%;
    padding-inline: 1rem;
    padding-block: clamp(0.5rem, 2vh, 1rem);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-continue {
    width: 100%;
    height: clamp(2.5rem, 7vh, 3.5rem);
    border-radius: 6.25rem;
    border: none;
    background-color: #82e46f;
    color: #43533e;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s, opacity 0.2s;
}

.btn-continue .material-symbols-rounded { color: #43533e; }
.btn-continue:active:not(:disabled) { transform: scale(0.98); }

.btn-continue:disabled {
    background-color: #293042;
    color: #404659;
    cursor: not-allowed;
}

.btn-continue:disabled .material-symbols-rounded { color: #404659; }

.btn-tertiary {
    background: transparent;
    border: none;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 500;
    color: var(--m3-on-surface-variant, #c5c6d0);
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.2s, opacity 0.2s;
}

.btn-tertiary:active { transform: scale(0.95); opacity: 0.8; }

.status {
    margin-top: 1rem;
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--m3-on-surface-variant, #c5c6d0);
    height: 1.2rem;
}

/* ── Result screen ── */
#result-screen {
    min-height: 0;
    overflow: hidden;
}

.result-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-block: 2rem;
}

.end-content-header {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0 1.5rem;
    width: 100%;
    margin-bottom: 2rem;
}

.stats-card {
    background-color: #D9DFF6;
    border-radius: 1.75rem;
    padding: 1.0625rem 1.125rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #1d192b;
    width: 100%;
}

.stats-card h2 {
    font-size: 1.5rem;
    font-weight: 500;
    text-align: center;
    line-height: 2rem;
}

.stats-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    flex-wrap: wrap;
    text-align: center;
}

.stats-card .stat { display: grid; align-items: center; }
.stats-card .stat span { font-size: 1rem; font-weight: 500; }
.stats-card .stat strong { font-size: 1.5rem; font-weight: 500; }

.stat-divider {
    width: 80%;
    height: 1px;
    background-color: rgba(29, 25, 43, 0.2);
    margin-block: 0.3rem;
}

.final-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0 1.5rem;
    flex-shrink: 0;
}

.btn-primary-large {
    width: 100%;
    height: 3.5rem;
    border-radius: 6.25rem;
    background-color: var(--m3-primary);
    color: var(--m3-on-primary, #ffffff);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-main);
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary-large:active { transform: scale(0.98); }

.btn-text-sair {
    background: transparent;
    border: none;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 500;
    color: var(--m3-on-surface-variant, #c5c6d0);
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.2s, opacity 0.2s;
}

.btn-text-sair:active { transform: scale(0.95); opacity: 0.8; }

/* ── Review list ── */
.review-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 1rem;
}

#review-chars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.review-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--m3-on-surface-variant);
    text-align: center;
}

.word-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--m3-secondary-container);
    border-radius: 1.75rem;
    padding: 1rem;
}

.word-card-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.word-character {
    font-family: "Noto Sans SC", var(--font-main);
    font-size: 2.25rem;
    font-weight: 400;
    color: var(--m3-on-secondary-container);
    width: 3rem;
    text-align: center;
    flex-shrink: 0;
    line-height: 2.875rem;
}

.word-pronunciation {
    font-size: 1rem;
    font-weight: 500;
    color: var(--m3-on-secondary-container);
    flex-shrink: 0;
}

.word-divider {
    width: 1px;
    height: 1.75rem;
    background-color: var(--m3-on-surface-variant);
    opacity: 0.3;
    flex-shrink: 0;
}

.word-meaning {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--m3-on-surface-variant);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.word-audio-btn {
    background-color: var(--m3-on-surface-variant);
    border: none;
    border-radius: 100px;
    width: 1.75rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--m3-background);
    transition: opacity 0.15s;
    cursor: pointer;
}

.word-audio-btn.disabled {
    background-color: rgba(226, 226, 233, 0.1);
    opacity: 0.38;
    cursor: not-allowed;
}

.word-audio-btn .material-symbols-rounded { font-size: 1.25rem; }
