:root {
    --bg: #faf8ef;
    --panel: #fff;
    --board: #e9e5dc;
    --dark: #3e3a37;
    --muted: #7a726c;
    --accent: #4CAF50;
    --accent-2: #8f7a66;
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    background: var(--bg);
    font-family: "Vazirmatn", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--dark);
    overscroll-behavior: none;
    user-select: none;
}

.wrap {
    max-width: min(92vw, 680px);
    margin: 24px auto 40px;
    padding: 0 12px;
}

.header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

h1 {
    margin: 0;
    line-height: 1.15;
    font-size: clamp(20px, 5vw, 32px);
    font-weight: 800
}

.scores {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.score-box {
    background: var(--accent-2);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
    min-width: 96px;
}

.score-box .lbl {
    display: block;
    font-size: 12px;
    opacity: .9
}

.score-box span:last-child {
    display: block;
    font-weight: 700;
    font-size: 18px
}

/* کلمات هدف */
.targets {
    margin: 16px 0 8px;
    background: var(--panel);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .08);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.word-slot {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    padding: 8px 6px;
    background: #f7f3ec;
    border-radius: 10px;
    min-height: 46px;
}

.letter-box {
    width: 28px;
    height: 34px;
    border-radius: 8px;
    background: #fff;
    border: 2px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #333;
}

.word-slot.filled {
    background: #e8fde9;
    border: 1px dashed #c7f2c9;
}

/* کلمه جاری */
.current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 0 6px;
}

.pill {
    background: #fff;
    border: 2px solid #eee;
    border-radius: 999px;
    padding: 10px 14px;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    min-width: 140px;
}

.actions {
    display: flex;
    gap: 8px
}

.btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 700;
}

.btn:hover {
    filter: brightness(.95)
}

.btn-ghost {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

/* چرخ حروف */
.wheel {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    background: var(--board);
    border-radius: 12px;
    margin-top: 8px;
    box-shadow: inset 0 0 0 10px #ddd;
    touch-action: none;
}

.letter {
    position: absolute;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: #333;
    transform: translate(-50%, -50%);
    transition: transform .05s ease, box-shadow .1s ease;
}

.letter.active {
    transform: translate(-50%, -50%) scale(0.92);
    box-shadow: 0 0 0 6px rgba(0, 0, 0, .06) inset;
}

/* اورلی‌ها */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.hidden {
    display: none
}

.modal {
    background: #fff;
    color: #333;
    padding: 22px 18px;
    border-radius: 12px;
    width: min(92vw, 420px);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2)
}

.modal h2 {
    margin: 8px 0 6px
}

.modal p {
    margin: 0 0 12px
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center
}