/* 반응형 놀이 넷의 화면 — 타깃 누르기(두더지·풍선), 순서대로 눌러요, 낙엽 쓸기. */

.tap-field,
.sweep-field {
    position: relative;
    border-radius: 14px;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-tertiary-bg);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    /* 연타·드래그가 스크롤이나 확대로 새지 않게 한다. */
    touch-action: none;
}

/* 두더지는 구멍이 고정이라 격자로 놓는다. */
.tap-field--holes {
    display: grid;
    grid-template-columns: repeat(var(--tap-cols, 3), 1fr);
    grid-template-rows: repeat(var(--tap-rows, 3), 1fr);
    gap: 10px;
    padding: 12px;
}

.tap-hole {
    position: relative;
    border-radius: 50%;
    background: var(--bs-secondary-bg);
    box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.22);
}

.tap-target {
    position: absolute;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    /* 터치 목표를 크게. 시니어 대상 화면이다. */
    font-size: 3rem;
    line-height: 1;
    touch-action: manipulation;
}

/* 두더지는 구멍 안에서 솟아오른다. */
.tap-target--mole {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: mole-rise 0.25s ease-out;
}

/* 풍선은 아래에서 위로 떠오른다. 자바스크립트로 좌표를 밀지 않고 CSS 가
   올린다 — 저사양 PC 에서도 부드럽게 돌아야 한다. */
.tap-target--balloon {
    left: var(--tap-x, 50%);
    bottom: -12%;
    animation: balloon-rise var(--tap-life, 6000ms) linear forwards;
}

@keyframes mole-rise {
    from { transform: translate(-50%, 20%); opacity: 0; }
    to { transform: translate(-50%, -50%); opacity: 1; }
}

@keyframes balloon-rise {
    from { bottom: -12%; }
    to { bottom: 104%; }
}

/* ---------- 순서대로 눌러요 ---------- */

.seq-pads {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    max-width: 460px;
    margin-inline: auto;
}

.seq-pad {
    aspect-ratio: 1 / 1;
    border: 3px solid rgba(0, 0, 0, 0.25);
    border-radius: 18px;
    background: var(--seq-color);
    color: #fff;
    font-family: var(--quiz-font-display, inherit);
    font-weight: 800;
    font-size: 2.4rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    opacity: 0.62;
    transition: opacity 0.12s ease, transform 0.12s ease;
    touch-action: manipulation;
}

/* 반짝임. 색만으로 알리지 않으려고 크기도 함께 키운다. */
.seq-pad--lit {
    opacity: 1;
    transform: scale(1.06);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.55);
}

.seq-pad:hover {
    opacity: 0.85;
}

/* ---------- 낙엽 쓸기 ---------- */

.sweep-leaf {
    position: absolute;
    left: var(--leaf-x, 50%);
    top: var(--leaf-y, 50%);
    transform: translate(-50%, -50%) rotate(var(--leaf-spin, 0deg));
    font-size: 2.2rem;
    line-height: 1;
    transition: opacity 0.2s ease, transform 0.3s ease;
    pointer-events: none;   /* 쓸기는 판이 받는다. 낙엽이 가로채면 안 된다 */
}

.sweep-leaf--gone {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--leaf-spin, 0deg)) scale(0.3);
}

/* ---------- 계기판 ---------- */

.reaction-stat {
    background: var(--bs-tertiary-bg);
    border-radius: 10px;
    padding: 8px 4px;
}

.reaction-stat-label {
    display: block;
    font-size: 0.72rem;
    color: var(--bs-secondary-color);
}

.reaction-stat-value {
    display: block;
    font-family: var(--quiz-font-display, inherit);
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.3;
}

.reaction-prompt {
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    min-height: 2.2rem;
    margin-bottom: 12px;
}

.reaction-status {
    min-height: 1.5rem;
    font-weight: 600;
}

.tap-stage:focus-visible,
.seq-stage:focus-visible,
.sweep-stage:focus-visible {
    outline: 3px solid var(--bs-primary);
    outline-offset: 6px;
    border-radius: 12px;
}

@media (max-width: 575.98px) {
    .tap-target { font-size: 2.3rem; }
    .sweep-leaf { font-size: 1.7rem; }
    .seq-pad { font-size: 1.9rem; }
}

@media (prefers-reduced-motion: reduce) {
    .tap-target--mole { animation: none; }
    .seq-pad, .sweep-leaf { transition: none; }
}
