/* ============================================================
   Arcade — Main Styles
   ============================================================ */

#arcade-root {
    width: 100%;
    min-height: 60vh;
}

.arcade-hidden {
    display: none !important;
}

/* ---- Landing Page ----------------------------------------- */

.arcade-title {
    text-align: center;
    margin: 1rem 0 1.5rem;
    font-size: 2rem;
    letter-spacing: 0.05em;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.game-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 0.75rem;
    transition: border-color 0.15s, background 0.15s;
    background: #f9f9f9;
}

.game-tile:hover,
.game-tile:focus {
    border-color: #555;
    background: #eee;
    outline: none;
}

.game-tile img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 4px;
}

.game-tile-name {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
}

/* ---- Game View -------------------------------------------- */

.arcade-game-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #ddd;
    background: #f5f5f5;
}

.arcade-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: background 0.15s;
}

.arcade-back-btn:hover {
    background: #ddd;
}

.arcade-back-icon {
    width: 28px;
    height: 28px;
}

.arcade-game-title-label {
    font-size: 1.1rem;
    font-weight: 600;
}

.game-container {
    width: 100%;
    min-height: 50vh;
    padding: 1rem;
    box-sizing: border-box;
}

/* ---- Shared Animations ------------------------------------ */

@keyframes arcade-shake {
    0%, 100% { transform: translateX(0); }
    15%       { transform: translateX(-8px); }
    30%       { transform: translateX(8px); }
    45%       { transform: translateX(-6px); }
    60%       { transform: translateX(6px); }
    75%       { transform: translateX(-3px); }
    90%       { transform: translateX(3px); }
}

@keyframes arcade-celebrate {
    0%   { transform: scale(1)    rotate(0deg);   opacity: 1; }
    25%  { transform: scale(1.08) rotate(-2deg);  opacity: 1; }
    50%  { transform: scale(1.12) rotate(2deg);   opacity: 1; }
    75%  { transform: scale(1.06) rotate(-1deg);  opacity: 1; }
    100% { transform: scale(1)    rotate(0deg);   opacity: 1; }
}

@keyframes arcade-flash {
    0%, 100% { background: inherit; }
    50%       { background: #fffde7; }
}

.arcade-anim-shake {
    animation: arcade-shake 0.5s ease-in-out;
}

.arcade-anim-celebrate {
    animation: arcade-celebrate 0.6s ease-in-out;
}

.arcade-anim-flash {
    animation: arcade-flash 0.4s ease-in-out 3;
}

/* ---- Shared Game UI Elements ------------------------------ */

.arcade-score-bar {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #333;
}

.arcade-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    border-radius: 6px;
    z-index: 10;
}

.arcade-overlay h2 {
    font-size: 1.6rem;
    margin: 0;
}

.arcade-overlay p {
    font-size: 1rem;
    margin: 0;
    color: #555;
}

.arcade-btn {
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid #333;
    border-radius: 6px;
    background: #fff;
    transition: background 0.15s;
}

.arcade-btn:hover {
    background: #eee;
}

/* ---- Typist ---------------------------------------- */

.mt-root {
    max-width: 700px;
    margin: 0 auto;
}

.mt-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: #444;
}

.mt-paragraph-wrap {
    position: relative;
    font-size: 1.25rem;
    line-height: 1.8;
    letter-spacing: 0.02em;
    font-family: monospace;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1rem;
    min-height: 100px;
    word-break: break-word;
}

.mt-char {
    color: #bbb;
    position: relative;
}

.mt-char.typed {
    color: #111;
}

.mt-char.cursor::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #333;
    animation: mt-blink 0.8s step-end infinite;
}

@keyframes mt-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.mt-overlay-wrap {
    position: relative;
}

/* ---- Flip Mix --------------------------------------------- */

.fm-root {
    max-width: 400px;
    margin: 0 auto;
}

.fm-steps {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #444;
}

.fm-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    width: 350px;
    position: relative;
}

.fm-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    border: 2px solid #888;
    cursor: pointer;
    background: #fff;
    transition: background 0.12s;
    outline: none;
}

.fm-cell.black {
    background: #222;
    border-color: #222;
}

.fm-cell.focused {
    outline: 3px solid #4a90d9;
    outline-offset: 1px;
}

.fm-overlay-wrap {
    position: relative;
}

/* ---- Fall ------------------------------------------------- */

.fall-root {
    max-width: 400px;
    margin: 0 auto;
}

.fall-score {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #444;
}

.fall-canvas-wrap {
    position: relative;
    border: 2px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
    line-height: 0;
}

.fall-canvas-wrap canvas {
    display: block;
    width: 100%;
}

.fall-overlay-wrap {
    position: relative;
}
