@charset "utf-8";
/* CSS Document */
html {
    height: auto;
    background-color: white;
}
.ColorTiles4 {
    /* 2 across / 2 down — capped by viewport width OR (viewport height minus
       ~240px fixed page chrome) so the whole 2x2 board always fits. */
    width: min(40vw, calc((100vh - 240px) / 2));
    height: min(40vw, calc((100vh - 240px) / 2));
    opacity: 1;
    display: inline-block;
    transition: opacity .05s ease-in-out;
    margin: 2px;
    background-color: black;
    border-radius: 15px;
}
.ColorTiles4:hover {
    opacity: 0.8;
}
.ColorTiles16 {
    /* 4 across / 4 down — capped by viewport width OR (viewport height minus
       ~240px fixed page chrome) so the whole 4x4 board always fits. */
    width: min(21vw, calc((100vh - 240px) / 4));
    height: min(21vw, calc((100vh - 240px) / 4));
    opacity: 1;
    display: inline-block;
    transition: opacity .05s ease-in-out;
    margin: 2px;
    background-color: black;
    border-radius: 15px;
}
.ColorTiles16:hover {
    opacity: 0.8;
}
.ColorTiles36 {
    /* 6 across / 6 down — capped by viewport width OR (viewport height minus
       ~240px of fixed page chrome: top nav, timer, margins, bottom bar) so
       the whole 6x6 board always fits on screen, any device. */
    width: min(14.5vw, calc((100vh - 240px) / 6));
    height: min(14.5vw, calc((100vh - 240px) / 6));
    opacity: 1;
    display: inline-block;
    transition: opacity .05s ease-in-out;
    margin: 2px;
    background-color: black;
    border-radius: 15px;
}
.ColorTiles36:hover {
    opacity: 0.8;
}

/* Kill the mobile/Chromebook double-tap-zoom delay so tile taps register
   instantly, and stop rapid taps from triggering zoom/scroll gestures. */
.ColorTiles4, .ColorTiles16, .ColorTiles36 {
    touch-action: manipulation;
}
.TileIn {
    opacity: 0.5;
}
.TileOut {
    opacity: 1;
}
a {
    text-decoration: none;
    color: black;
}
a:hover {
    text-decoration: none;
    color: red;
}
#Banner {
    height: 50px;
    width: 100%;
    text-align: center;
    padding-top: 5px;
    font-size: 40px;
    word-spacing: 10px;
    background-color: white;
    color: black;
}
.Menu {
    height: 25px;
    text-align: center;
    word-spacing: 20px;
}
#RowContainers {
    text-align: center;
}
.Rows {
    display: block;
    width: 100%;
    white-space: nowrap;
    text-align: center;
    margin-bottom: -2px;
}
.Score {
    text-align: center;
    width: 100%;
    color: white;
    font-size: 20px;
}
#minutes, #seconds {
    width: 20px;
}
#TimerContainer {
    color: black;
}

/* ---- Fun end-of-game modal (replaces the plain browser confirm) ---- */
.em-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 99999;
    background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center;
    animation: emFade .2s ease;
}
@keyframes emFade { from { opacity: 0; } to { opacity: 1; } }
.em-card {
    background: #fff; border-radius: 26px;
    padding: 26px 44px 32px; text-align: center; max-width: 90vw;
    box-shadow: 0 14px 44px rgba(0,0,0,.4);
    border-top: 12px solid #198754;
    animation: emPop .4s cubic-bezier(.18,.89,.32,1.28);
}
@keyframes emPop {
    0%   { transform: scale(.5); opacity: 0; }
    100% { transform: scale(1);  opacity: 1; }
}
.em-emoji {
    font-size: 66px; line-height: 1; margin-bottom: 4px;
    animation: emWiggle 1.1s ease-in-out infinite;
}
@keyframes emWiggle {
    0%,100% { transform: rotate(-9deg); }
    50%     { transform: rotate(9deg); }
}
.em-title  { font-size: 42px; font-weight: 800; color: #198754; margin-bottom: 6px; }
.em-detail { font-size: 24px; color: #444; margin-bottom: 24px; }
.em-btns   { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.em-btn {
    border: none; border-radius: 999px; padding: 14px 32px;
    font-size: 22px; font-weight: 700; cursor: pointer;
    transition: transform .08s ease, filter .15s ease;
}
.em-btn:hover  { filter: brightness(1.08); }
.em-btn:active { transform: scale(.94); }
.em-again { background: #198754; color: #fff; }
.em-quit  { background: #e9ecef; color: #495057; }
@media (prefers-reduced-motion: reduce) {
    .em-overlay, .em-card, .em-emoji { animation: none; }
}
