/* =====================================================
   Game Modules Common Styles
   ===================================================== */
.abq-game-container{
    max-width: 720px;
    margin: 0 auto;
    padding: 24px;
}.abq-game-card, .abq-game-card{
    background: white;
    border-radius: var(--abq-radius-xl);
    padding: 32px;
    box-shadow: var(--abq-shadow-lg);
}.abq-game-header, .abq-game-header{
    text-align: center;
    margin-bottom: 28px;
}.abq-game-header h2, .abq-game-header h2{
    font-family: var(--abq-font-heading);
    font-size: 1.6rem;
    color: var(--abq-gray-900);
    margin-bottom: 8px;
}.abq-game-header p, .abq-game-header p{
    color: var(--abq-gray-500);
    font-size: 0.95rem;
}.abq-game-score, .abq-game-score{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

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

.score-item .value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--abq-primary);
}

.score-item .label {
    font-size: 0.8rem;
    color: var(--abq-gray-500);
    font-weight: 600;
}

/* Wordle Specific */
.wordle-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 28px;
}

.wordle-row {
    display: flex;
    gap: 6px;
}

.wordle-tile {
    width: 52px;
    height: 52px;
    border: 2px solid var(--abq-gray-300);
    border-radius: var(--abq-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    text-transform: uppercase;
    transition: all 0.3s ease;
    background: white;
}

.wordle-tile.filled {
    border-color: var(--abq-gray-400);
    animation: popIn 0.1s ease;
}

.wordle-tile.correct {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
    animation: flipIn 0.5s ease;
}

.wordle-tile.present {
    background: #eab308;
    border-color: #eab308;
    color: white;
    animation: flipIn 0.5s ease;
}

.wordle-tile.absent {
    background: var(--abq-gray-400);
    border-color: var(--abq-gray-400);
    color: white;
    animation: flipIn 0.5s ease;
}

.wordle-keyboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.wordle-keyboard-row {
    display: flex;
    gap: 5px;
}

.wordle-key {
    min-width: 36px;
    height: 52px;
    padding: 0 10px;
    border-radius: var(--abq-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    background: var(--abq-gray-200);
    color: var(--abq-gray-700);
    transition: all 0.15s ease;
    user-select: none;
}

.wordle-key:hover { background: var(--abq-gray-300); }
.wordle-key.wide { min-width: 58px; font-size: 0.75rem; }

.wordle-key.correct { background: #22c55e; color: white; }
.wordle-key.present { background: #eab308; color: white; }
.wordle-key.absent { background: var(--abq-gray-500); color: white; }

/* Whack-a-Mole / Listening Game */
.whack-game-area {
    background: linear-gradient(180deg, #86efac 0%, #4ade80 50%, #22c55e 100%);
    border-radius: var(--abq-radius-lg);
    padding: 32px;
    min-height: 360px;
    position: relative;
    margin-bottom: 24px;
}

.whack-holes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 420px;
    margin: 0 auto;
}

.whack-hole {
    aspect-ratio: 1;
    background: #92400e;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    box-shadow: inset 0 -8px 16px rgba(0,0,0,0.3);
    overflow: hidden;
}

.whack-mole {
    position: absolute;
    bottom: -80%;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    width: 75%;
    height: 80%;
    background: #a16207;
    border-radius: 50% 50% 45% 45%;
    transition: bottom 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: white;
    text-transform: capitalize;
}

.whack-hole.active .whack-mole {
    bottom: 15%;
}

.whack-hole.hit .whack-mole {
    background: var(--abq-red);
}

.whack-instruction {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    margin-bottom: 16px;
}

.whack-speaker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    margin: 0 auto;
}

.whack-speaker:hover { transform: scale(1.1); }
.whack-speaker.playing { animation: pulse 0.6s ease infinite; }

/* Match Game (连连看) */
.match-game-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 24px;
}

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

.match-column-title {
    text-align: center;
    font-weight: 800;
    font-size: 1rem;
    color: var(--abq-gray-500);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px dashed var(--abq-gray-200);
}

.match-card {
    padding: 14px 20px;
    border: 2px solid var(--abq-gray-200);
    border-radius: var(--abq-radius-md);
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    user-select: none;
}

.match-card:hover { border-color: var(--abq-blue); background: #eff6ff; }
.match-card.selected { 
    border-color: var(--abq-blue); 
    background: #dbeafe; 
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}
.match-card.matched { 
    border-color: var(--abq-primary); 
    background: #dcfce7; 
    opacity: 0.6;
    pointer-events: none;
}
.match-card.wrong {
    border-color: var(--abq-red);
    background: #fee2e2;
    animation: shake 0.4s ease;
}

/* Synonym Crush (消消乐) */
.crush-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-width: 450px;
    margin: 0 auto 24px;
}

.crush-cell {
    aspect-ratio: 1;
    border-radius: var(--abq-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    user-select: none;
    text-transform: capitalize;
}

.crush-cell:hover { transform: scale(1.08); }

.crush-cell.c1 { background: #dcfce7; color: #15803d; }
.crush-cell.c2 { background: #dbeafe; color: #1d4ed8; }
.crush-cell.c3 { background: #fef3c7; color: #b45309; }
.crush-cell.c4 { background: #f3e8ff; color: #7c3aed; }
.crush-cell.c5 { background: #ffe4e6; color: #be185d; }
.crush-cell.c6 { background: #ccfbf1; color: #0f766e; }

.crush-cell.selected { 
    border-color: var(--abq-gray-800); 
    transform: scale(1.1);
    box-shadow: var(--abq-shadow-lg);
}

.crush-cell.matched {
    animation: crushPop 0.4s ease forwards;
    opacity: 0;
    transform: scale(0);
}

/* ── Touch optimization ── */
.wordle-key, .whack-hole, .match-card, .crush-cell {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
    .abq-game-container { padding: 16px; }
    .abq-game-card { padding: 24px 16px; }
    .abq-game-header h2 { font-size: 1.3rem; }

    /* Wordle: smaller tiles + keyboard */
    .wordle-tile { width: 40px; height: 40px; font-size: 1.1rem; }
    .wordle-key { min-width: 28px; height: 44px; padding: 0 6px; font-size: 0.75rem; }
    .wordle-key.wide { min-width: 44px; }
    .wordle-keyboard { gap: 4px; }
    .wordle-keyboard-row { gap: 3px; }

    /* Whack: smaller grid */
    .whack-game-area { padding: 20px 12px; min-height: 280px; }
    .whack-holes { gap: 12px; max-width: 320px; }
    .whack-instruction { font-size: 0.95rem; }
    .whack-speaker { width: 48px; height: 48px; font-size: 1.4rem; }

    /* Match: stack columns */
    .match-game-area { grid-template-columns: 1fr; gap: 20px; }
    .match-card { padding: 12px 16px; font-size: 0.9rem; }

    /* Crush: reduce to 4 columns */
    .crush-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; max-width: 320px; }
    .crush-cell { font-size: 0.75rem; }
}

@media (max-width: 480px) {
    .wordle-tile { width: 32px; height: 32px; font-size: 0.95rem; }
    .wordle-key { min-width: 22px; height: 40px; font-size: 0.7rem; padding: 0 4px; }
    .wordle-key.wide { min-width: 36px; }

    .whack-holes { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    .crush-grid { grid-template-columns: repeat(3, 1fr); max-width: 260px; }
}

