@charset "utf-8";
/* FinalRecall16 — Neon Cyberpunk + Single‑File Scroll Edition */

/* ===============================
   GLOBAL PAGE STYLE
   =============================== */
body {
    margin: 0;
    background-color: #000;
    color: #fff;
    font-family: Arial, sans-serif;
    text-align: center;
}

#app {
    padding: 20px;
}

.logo {
    text-align: center;
}

/* ===============================
   MODE SELECTION SCREEN
   =============================== */
#modeSelectContainer {
    margin-top: 40px;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 35px;
    justify-items: center;
    margin-top: 30px;
}

.mode-btn {
    width: 200px;
    height: 200px;
    border-radius: 18px;
    font-size: 4rem;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Neon Colors (Set B) */
#mode1 { background: #00eaff; box-shadow: 0 0 25px #00eaff; color: #000; }
#mode2 { background: #ff00c8; box-shadow: 0 0 25px #ff00c8; color: #000; }
#mode3 { background: #00ff4c; box-shadow: 0 0 25px #00ff4c; color: #000; }
#mode4 { background: #ff7b00; box-shadow: 0 0 25px #ff7b00; color: #000; }

.mode-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 40px rgba(0,255,255,0.9);
}

/* Labels under buttons */
.mode-label {
    margin-top: 10px;
    font-size: 1.3rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.6);
}

/* ===============================
   GAME STYLE SELECT (Single/Double)
   =============================== */
#gameStyleSelect {
    margin-top: 40px;
    transition: opacity 0.6s ease;
    display: none;
}

.style-btn {
    width: 260px;
    padding: 14px 28px;
    margin: 12px auto;
    border-radius: 10px;
    font-size: 1.4rem;
    cursor: pointer;
    background: #3498db;
}

.style-btn:hover {
    background: #4fb4ff;
}

/* ===============================
   SINGLE‑FILE SCROLL MEMORY ROUND
   =============================== */
.scroll-rounds {
    height: 100vh;
    overflow: hidden;
    position: relative;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;

    /* Fade edges top + bottom (film reel effect) */
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 10%,
        black 90%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 10%,
        black 90%,
        transparent 100%
    );
}

.scroll-item {
    display: flex;
    align-items: center;          /* vertically center arrow vs tile */
    justify-content: center;
    gap: 20px;
    height: 140px;                /* vertical spacing per item */
}

.scroll-tile-box {
    width: 110px;
    height: 110px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0,255,255,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-tile {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.scroll-arrow-box {
    width: 80px;   /* arrow slightly smaller than tile */
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-arrow {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 12px rgba(0,255,255,0.7));
}

/* Fade out scroll container before Final Recall */
.fade-out-scroll {
    animation: fadeOutScroll 0.8s ease-out forwards;
}

@keyframes fadeOutScroll {
    0%   { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.96); }
}

/* ===============================
   ROUND + FINAL RECALL (existing styles)
   =============================== */
.round-wrapper {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
    align-items: flex-start;
}

.round-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.round-arrow {
    width: 105px;
    height: auto;
    margin-bottom: 6px;
    animation: arrowPulseLoop 1.2s ease-in-out infinite;
    filter: drop-shadow(0 0 12px rgba(0,255,255,0.7));
}

.img-box {
    width: 105px;
    height: 105px;
    border-radius: 10px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0,255,255,0.35);
}

.img-box img {
    width: 100%;
    height: auto;
}

.fade-out-tile {
    animation: fadeOutTile 1s ease-out forwards;
}

@keyframes fadeOutTile {
    0%   { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.9); }
}

.grid-40 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 18px;
    padding: 20px;
    justify-items: center;
}

.final-img {
    width: 95px;
    height: 95px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    text-align: center;
    transition: transform 0.2s ease;
}

.final-img:hover {
    transform: scale(1.05);
}

.final-img img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    animation: neonPulse 2.2s infinite ease-in-out;
}

@keyframes neonPulse {
    0%   { box-shadow: 0 0 10px rgba(0,255,255,0.35); }
    50%  { box-shadow: 0 0 22px rgba(0,255,255,0.75); }
    100% { box-shadow: 0 0 10px rgba(0,255,255,0.35); }
}

.overlay-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    opacity: 0.95;
    border-radius: 10px;
}

.correct-flash {
    animation: flashGreen 0.45s ease-out;
}

@keyframes flashGreen {
    0%   { box-shadow: 0 0 0px rgba(0,255,0,0.0); }
    40%  { box-shadow: 0 0 25px rgba(0,255,0,0.9); }
    100% { box-shadow: 0 0 0px rgba(0,255,0,0.0); }
}

.shake {
    animation: shakeAnim 0.4s ease-in-out;
}

@keyframes shakeAnim {
    0% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

.arrow-pulse-loop {
    animation: arrowPulseLoop 1.2s ease-in-out infinite;
}

@keyframes arrowPulseLoop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* ===============================
   MOBILE RESPONSIVE FIXES
   =============================== */
@media (max-width: 600px) {

    .mode-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .mode-btn {
        width: 130px;
        height: 130px;
        font-size: 2.8rem;
        border-radius: 14px;
    }

    .mode-label {
        font-size: 1rem;
        margin-top: 6px;
    }

    h2 {
        font-size: 1.4rem;
    }

    #app {
        padding: 10px;
    }

    .scroll-item {
        height: 120px;
        gap: 14px;
    }

    .scroll-tile-box {
        width: 95px;
        height: 95px;
    }

    .scroll-arrow-box {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 400px) {

    .mode-grid {
        gap: 15px;
    }

    .mode-btn {
        width: 110px;
        height: 110px;
        font-size: 2.4rem;
    }

    .mode-label {
        font-size: 0.9rem;
    }
}

/* ===============================
   START BUTTON + MODE BUTTONS
   =============================== */
#startBtn {
    font-size: 1.2em;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    background-color: #00ffff;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 12px #00ffff, 0 0 24px #00ffff inset;
    transition: all 0.3s ease;
}

#startBtn:hover {
    background-color: #0ff;
    box-shadow: 0 0 20px #00ffff, 0 0 40px #00ffff inset;
    transform: scale(1.08);
}

#singleMode,
#doubleMode {
    color: #ffffff;
    font-weight: bold;
    background-color: #0099ff;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    box-shadow: 0 0 12px #00ffff, 0 0 24px #00ffff inset;
    transition: all 0.3s ease;
}

#singleMode:hover,
#doubleMode:hover {
    background-color: #00ccff;
    box-shadow: 0 0 20px #00ffff, 0 0 40px #00ffff inset;
    transform: scale(1.05);
}

/* ===============================
   FINAL RECALL GRID LAYOUT
   =============================== */
.final-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    max-width: 800px;
}

.flash {
    animation: flashRed 0.5s alternate infinite;
}

@keyframes flashRed {
    from { color: red; text-shadow: 0 0 10px red; }
    to   { color: yellow; text-shadow: 0 0 10px white; }
}

/* ===============================
   TIMER VISUAL ENHANCEMENTS
   =============================== */
.final-timer {
    font-size: 60px;
    font-weight: bold;
    color: yellow;
    text-align: center;
    margin-top: 20px;
    text-shadow: 0 0 10px white;
}
/* Default desktop style */
.final-timer {
  font-size: 48px;
  font-weight: bold;
  color: yellow;
  text-align: center;
}

/* Responsive adjustment for mobile */
@media (max-width: 600px) {
  .final-timer {
    font-size: 28px; /* smaller text */
    margin-top: 10px;
  }
}
@media (min-width: 601px) {
  #finalTimerBottom {
    display: none;
  }
}


/* ===============================
   Pre‑Game Turn Timer + Button
   =============================== */
#startCardTimer {
    display: block;
    margin: 20px auto 10px auto;
    padding: 12px 28px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    color: #fff;
    background: transparent;
    border: 2px solid #00eaff;
    border-radius: 8px;
    text-shadow: 0 0 8px #00eaff;
    box-shadow: 0 0 12px #00eaff, inset 0 0 12px #00eaff;
    transition: 0.2s ease;
}

#startCardTimer:hover {
    box-shadow: 0 0 18px #00eaff, inset 0 0 18px #00eaff;
    transform: scale(1.05);
}

#cardTimer {
    text-align: center;
    margin: 10px 0 20px 0;
    font-size: 1.6rem;
    font-weight: bold;
    color: yellow;
    text-shadow: 0 0 10px yellow;
}

.cardTimeNumber {
    color: white;
    font-size: 2em;
    font-weight: bold;
}

/* ===============================
   Neon Glow + Pulse for Finish Button
   =============================== */
.finish-button {
    box-shadow: 0 0 12px #28ff7a, 0 0 24px #28ff7a;
    animation: neonPulseFinish 1.2s ease-in-out infinite;
    transition: transform 0.2s ease;
}

.finish-button:hover {
    transform: scale(1.08);
    box-shadow: 0 0 16px #28ff7a, 0 0 32px #28ff7a;
}

.finishButton2 {
    box-shadow: 0 0 12px #28ff7a, 0 0 24px #28ff7a;
    animation: neonPulseFinish 1.2s ease-in-out infinite;
    transition: transform 0.2s ease;
    width: 70%;
    margin-bottom: 25px;
    margin-top: 10px;
    margin-right: auto;
    margin-left: auto;
}

@keyframes neonPulseFinish {
    0% {
        box-shadow: 0 0 10px #28ff7a, 0 0 20px #28ff7a;
    }
    50% {
        box-shadow: 0 0 18px #28ff7a, 0 0 36px #28ff7a;
    }
    100% {
        box-shadow: 0 0 10px #28ff7a, 0 0 20px #28ff7a;
    }
}

/* ===============================
   Info Popup
   =============================== */
.tile-instruction {
    margin-top: 15px;
    font-size: 15px;
    color: aqua;
    text-align: center;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.3;
}

.info-icon {
    color: #00eaff;
    font-size: 18px;
    cursor: pointer;
    margin-top: 30px;
    text-decoration: underline;
}

.info-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 999;
}

.popup-content {
    background: #111;
    color: #00eaff;
    padding: 20px;
    margin: 80px auto;
    width: 80%;
    max-width: 400px;
    border-radius: 10px;
    text-align: left;
    border: 2px solid #00eaff;
}

.close-popup {
    margin-top: 15px;
    padding: 10px 20px;
    background: #00eaff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: black;
    font-weight: bold;
}
