/* =========================================
   PROJECT PIHU — MAIN STYLESHEET
   Original UI + Consolidated Fun Zone Arcade
========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ease: cubic-bezier(.22, 1, .36, 1);
    --spring: cubic-bezier(.2, .9, .25, 1);
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont,
                 "SF Pro Display", "Segoe UI", sans-serif;
    background: #17131d;
    color: white;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

button {
    border: none;
    cursor: pointer;
    color: inherit;
    font: inherit;
}

.device {
    position: relative;
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    isolation: isolate;
    background: #17131d;
}

/* ==========================
   LOCK SCREEN
========================== */

.lock-screen {
    position: absolute;
    inset: 0;
    z-index: 10;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;

    transition:
        transform 1.05s var(--spring),
        opacity .8s ease,
        filter .8s ease;

    will-change: transform;
}

.lock-wallpaper {
    position: absolute;
    inset: 0;
    z-index: -1;

    background:
        linear-gradient(
            to bottom,
            rgba(0,0,0,.2),
            transparent 35%,
            rgba(0,0,0,.3)
        ),
        url("assets/mars.jpg") center / cover no-repeat;

    transform: scale(1.03);
}

.lock-status {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: max(18px, env(safe-area-inset-top)) 28px 0;
    font-size: 13px;
    font-weight: 600;
}

.lock-clock-area {
    text-align: center;
    margin-top: auto;
    margin-bottom: auto;
    transform: translateY(-15px);
    text-shadow: 0 4px 30px rgba(0,0,0,.3);
}

#lockDate {
    font-size: 19px;
    font-weight: 500;
    margin-bottom: -8px;
}

#lockClock {
    font-family:
        "SF Pro Display",
        "SF Pro Rounded",
        -apple-system,
        BlinkMacSystemFont,
        "Helvetica Neue",
        sans-serif;

    font-size: clamp(95px, 19vw, 170px);
    font-weight: 300;
    letter-spacing: -6px;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;

    text-shadow:
        0 4px 25px rgba(0,0,0,.18);
}

.lock-subtitle {
    font-family: Georgia, serif;
    font-size: 19px;
}

.notification {
    width: min(500px, calc(100% - 36px));
    min-height: 75px;
    padding: 16px;
    margin-bottom: 20px;

    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;

    border-radius: 22px;
    border: 1px solid rgba(255,255,255,.35);

    background: rgba(255,255,255,.2);
    backdrop-filter: blur(35px) saturate(150%);
    -webkit-backdrop-filter: blur(35px) saturate(150%);

    box-shadow: 0 12px 35px rgba(0,0,0,.12);

    transition: transform .3s var(--spring);
}

.notification:active {
    transform: scale(.97);
}

.notification-icon {
    font-size: 28px;
}

.notification strong,
.notification small {
    display: block;
}

.notification strong {
    font-size: 13px;
}

.notification small {
    font-size: 11px;
    opacity: .8;
    margin-top: 5px;
}

.unlock-area {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    font-size: 12px;
    opacity: .9;
}

.unlock-arrow {
    font-size: 24px;
    animation: arrowFloat 1.6s ease-in-out infinite;
}

@keyframes arrowFloat {
    0%,100% { transform: translateY(3px); }
    50% { transform: translateY(-5px); }
}

.lock-indicator,
.home-indicator {
    width: 110px;
    height: 5px;
    border-radius: 20px;
    background: white;
}

/* ACTUAL UNLOCK */

.lock-screen.unlocking {
    transform: translateY(-100%);
    opacity: .92;
    filter: blur(5px);
    pointer-events: none;
}

.lock-screen.unlocked {
    visibility: hidden;
    pointer-events: none;
}

/* ==========================
   HOME SCREEN
========================== */

.home-screen {
    position: absolute;
    inset: 0;
    overflow: hidden;

    display: flex;
    flex-direction: column;

    opacity: 0;
    transform: scale(1.035);

    transition:
        opacity .8s ease,
        transform 1.05s var(--spring);
}

.home-screen.visible {
    opacity: 1;
    transform: scale(1);
}

.home-wallpaper {
    position: absolute;
    inset: 0;
    z-index: -1;

    background:
        linear-gradient(
            145deg,
            rgba(255,235,225,.2),
            rgba(231,187,211,.25)
        ),
        url("assets/home-wallpaper.jpg") center / cover no-repeat,
        linear-gradient(135deg,#edc8ce,#e7c9e5);
}

.status-bar {
    display: flex;
    justify-content: space-between;
    padding: max(17px, env(safe-area-inset-top)) 28px 0;
    color: #634b5c;
    font-size: 12px;
    font-weight: 700;
}

.home-content {
    width: min(1050px, 100%);
    margin: auto;
    padding: 16px 35px;
    flex: 1;

    display: flex;
    flex-direction: column;
    justify-content: center;

    overflow: hidden;
}

.welcome {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.eyebrow,
.widget-label {
    font-size: 9px;
    letter-spacing: 1.6px;
    font-weight: 700;
    color: #86677b;
}

.welcome h1 {
    font-family: Georgia, serif;
    font-size: clamp(30px, 5vw, 45px);
    margin: 5px 0;
    color: #563d4d;
}

.welcome h1 span {
    color: #c96f98;
}

.welcome p:last-child {
    font-size: 12px;
    color: #846b7a;
}

.avatar {
    width: 55px;
    height: 55px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    font-family: Georgia, serif;
    font-size: 25px;
    color: #80536a;
    background: linear-gradient(145deg,#fff1e6,#e9b4c9);
    box-shadow: 0 8px 25px #875b7625;
}

.widgets {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 15px;
}

.widget {
    border: 1px solid rgba(255,255,255,.65);
    border-radius: 25px;
    padding: 17px;

    background: rgba(255,255,255,.35);
    backdrop-filter: blur(30px) saturate(140%);
    -webkit-backdrop-filter: blur(30px) saturate(140%);

    box-shadow: 0 12px 35px rgba(111,70,96,.09);
}

.birthday-widget {
    min-height: 155px;
}

.cake {
    font-size: 26px;
    margin: 8px 0 2px;
}

.widget h2 {
    font-family: Georgia, serif;
    font-size: 21px;
    color: #63465a;
}

.widget p {
    font-size: 11px;
    color: #846b7a;
    margin-top: 5px;
}

.widget button {
    background: transparent;
    color: #ad6084;
    font-size: 11px;
    font-weight: 700;
    margin-top: 12px;
}

.reminder-widget {
    min-height: 155px;
}

.sun {
    font-size: 25px;
    margin: 12px 0;
}

.reminder-widget h3 {
    font-family: Georgia, serif;
    color: #674b5f;
    font-size: 19px;
}

.apps-title {
    font-family: Georgia, serif;
    color: #654a5e;
    font-size: 20px;
    margin: 22px 0 15px;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.app {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    background: transparent;
    color: #634a5b;
    font-size: 11px;
    font-weight: 600;
}

.app-icon {
    width: 58px;
    height: 58px;
    border-radius: 19px;
    display: grid;
    place-items: center;
    font-size: 26px;

    box-shadow: 0 9px 20px rgba(91,54,79,.15);
    border: 1px solid rgba(255,255,255,.7);

    transition:
        transform .35s var(--spring),
        box-shadow .35s ease;
}

.app:active .app-icon {
    transform: scale(.85);
}

.pink { background: linear-gradient(145deg,#ffe5ef,#efaac6); }
.peach { background: linear-gradient(145deg,#fff0dc,#edbda0); }
.purple { background: linear-gradient(145deg,#f1e5ff,#c6b0e6); }
.music { background: linear-gradient(145deg,#ffe3ed,#e6a8ca); font-size:34px; }
.cream { background: linear-gradient(145deg,#fff5df,#eed2b0); }
.mint { background: linear-gradient(145deg,#e6f7e9,#abd9c8); }

.dock {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 17px;

    width: max-content;
    max-width: calc(100% - 30px);

    padding: 11px 19px;
    margin: 0 auto 12px;

    border-radius: 25px;
    background: rgba(255,255,255,.35);
    border: 1px solid rgba(255,255,255,.65);

    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}

.dock button {
    width: 47px;
    height: 47px;
    border-radius: 16px;
    background: rgba(255,255,255,.55);
    font-size: 23px;
}

.home-indicator {
    margin: 0 auto;
    margin-bottom: max(8px, env(safe-area-inset-bottom));
    background: rgba(85,60,76,.7);
}

/* ==========================
   APP WINDOWS
========================== */

.app-layer {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 15px;

    background: rgba(40,25,38,.18);
    backdrop-filter: blur(8px);
}

.app-layer.open {
    display: flex;
    animation: layerIn .35s ease both;
}

@keyframes layerIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.app-window {
    width: min(700px, 100%);
    max-height: 85%;
    overflow: auto;
    border-radius: 27px;

    background: rgba(255,249,250,.9);
    color: #634a5b;

    border: 1px solid white;
    box-shadow: 0 25px 90px #3c203c30;

    transform: translateY(30px) scale(.94);
    opacity: 0;

    transition:
        transform .5s var(--spring),
        opacity .3s ease;
}

.app-layer.open .app-window {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 17px;
    border-bottom: 1px solid #ead8e1;
}

.app-header h2 {
    font-family: Georgia, serif;
    font-size: 22px;
}

.app-header button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #edc4d4;
    font-size: 20px;
    color: #80536a;
}

.app-header span {
    margin-left: auto;
    color: #bd7194;
}

.app-content {
    padding: 22px;
    font-size: 14px;
    line-height: 1.8;
}

/* ==========================
   CONTROL CENTRE
========================== */

.control-centre {
    position: absolute;
    z-index: 30;
    top: 12px;
    right: 12px;
    width: min(340px, calc(100% - 24px));
    padding: 20px;

    border-radius: 27px;
    background: rgba(255,249,252,.88);
    color: #654b5e;

    border: 1px solid white;
    box-shadow: 0 20px 60px #51344a30;
    backdrop-filter: blur(35px);

    display: none;
    animation: controlIn .4s var(--spring);
}

.control-centre.open {
    display: block;
}

@keyframes controlIn {
    from { opacity: 0; transform: translateY(-20px) scale(.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-header button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #efd3df;
    font-size: 20px;
}

.control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
}

.control-grid div {
    background: #ffffffb8;
    padding: 15px;
    border-radius: 17px;
    font-size: 22px;
}

.control-grid small {
    display: block;
    font-size: 10px;
    margin-top: 6px;
}

/* ==========================
   RESPONSIVE — MAIN UI
========================== */


/* =========================================
   PROJECT PIHU — RESPONSIVE MAIN UI
   Mobile • Tablet • Laptop • Desktop
   Fun Zone and Passcode styling excluded
========================================= */

/* ---------- TABLETS AND MEDIUM SCREENS ---------- */

@media (min-width: 651px) and (max-width: 1024px) {

    .home-content {
        width: min(900px, 100%);
        padding: 18px 28px;
    }

    .widgets {
        gap: 12px;
    }

    .app-grid {
        gap: 18px;
    }

    .app-icon {
        width: 56px;
        height: 56px;
    }

    .app-layer {
        padding: 20px;
    }

    .app-window:not(:has(#funZoneArcade)) {
        width: min(760px, 100%);
        max-height: 88dvh;
    }
}

/* ---------- MOBILE ---------- */

@media (max-width: 650px) {

    /* Home layout */

    .home-content {
        width: 100%;
        min-height: 0;
        padding: 12px 17px;
    }

    .welcome {
        gap: 12px;
        margin-bottom: 15px;
    }

    .welcome h1 {
        font-size: clamp(27px, 7vw, 36px);
    }

    .welcome p:last-child {
        font-size: 11px;
    }

    .avatar {
        width: 49px;
        height: 49px;
        flex-shrink: 0;
        border-radius: 17px;
    }

    /* Widgets */

    .widgets {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .widget {
        min-width: 0;
        padding: 12px;
        border-radius: 19px;
    }

    .birthday-widget,
    .reminder-widget {
        min-height: 135px;
    }

    .widget h2 {
        font-size: 18px;
    }

    .widget p {
        font-size: 10px;
        line-height: 1.45;
    }

    .reminder-widget h3 {
        font-size: 16px;
    }

    /* App icons */

    .apps-title {
        margin: 17px 0 12px;
        font-size: 19px;
    }

    .app-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 17px 9px;
    }

    .app {
        min-width: 0;
        font-size: 10px;
    }

    .app-icon {
        width: 53px;
        height: 53px;
        border-radius: 17px;
        font-size: 24px;
    }

    /* Dock */

    .dock {
        gap: clamp(8px, 3vw, 13px);
        padding: 9px 13px;
        margin-bottom: 10px;
    }

    .dock button {
        width: clamp(37px, 11vw, 44px);
        height: clamp(37px, 11vw, 44px);
        border-radius: 14px;
        font-size: 21px;
    }

    /* Lock screen */

    .lock-status,
    .status-bar {
        padding-left: 18px;
        padding-right: 18px;
    }

    #lockClock {
        font-size: clamp(88px, 23vw, 125px);
        letter-spacing: -4px;
    }

    #lockDate {
        font-size: 16px;
    }

    .lock-subtitle {
        font-size: 16px;
    }

    .lock-clock-area {
        transform: translateY(-18px);
    }

    .notification {
        width: calc(100% - 28px);
        min-height: 68px;
        padding: 13px;
        margin-bottom: 15px;
        border-radius: 19px;
    }

    /* General app windows — Fun Zone excluded */

    .app-layer {
        padding: 9px;
    }

    .app-window:not(:has(#funZoneArcade)) {
        width: 100%;
        max-width: 100%;
        max-height: 92dvh;
        border-radius: 23px;
    }

    .app-header {
        gap: 10px;
        padding: 14px;
    }

    .app-header h2 {
        font-size: 19px;
    }

    .app-content {
        padding: 17px;
        font-size: 13px;
    }

    /* Control Centre */

    .control-centre {
        top: max(9px, env(safe-area-inset-top));
        right: 9px;
        width: min(340px, calc(100% - 18px));
        padding: 16px;
        border-radius: 23px;
    }
}

/* ---------- VERY SMALL PHONES ---------- */

@media (max-width: 380px) {

    .home-content {
        padding-left: 12px;
        padding-right: 12px;
    }

    .welcome h1 {
        font-size: 27px;
    }

    .avatar {
        width: 44px;
        height: 44px;
    }

    .widget {
        padding: 10px;
    }

    .birthday-widget,
    .reminder-widget {
        min-height: 125px;
    }

    .app-grid {
        column-gap: 5px;
        row-gap: 14px;
    }

    .app-icon {
        width: 48px;
        height: 48px;
        border-radius: 15px;
    }

    .dock {
        gap: 8px;
        padding: 8px 10px;
    }
}

/* ---------- SHORT SCREENS / LANDSCAPE ---------- */

@media (max-height: 700px) {

    .home-content {
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .welcome {
        margin-bottom: 8px;
    }

    .welcome h1 {
        font-size: clamp(25px, 4vw, 34px);
    }

    .widgets .widget {
        min-height: 112px;
    }

    .apps-title {
        margin: 10px 0;
    }

    .app-grid {
        gap: 9px;
    }

    .app-icon {
        width: 45px;
        height: 45px;
        border-radius: 14px;
        font-size: 21px;
    }

    .dock {
        padding: 7px 12px;
        margin-bottom: 7px;
    }

    .dock button {
        width: 36px;
        height: 36px;
        font-size: 19px;
    }

    #lockClock {
        font-size: clamp(75px, 16vh, 115px);
    }

    .lock-clock-area {
        transform: translateY(-8px);
    }

    .notification {
        min-height: 60px;
        margin-bottom: 10px;
    }
}

/* ---------- EXTRA SHORT SCREENS ---------- */

@media (max-height: 560px) {

    .widgets .widget {
        min-height: 95px;
    }

    .widget .cake,
    .widget .sun {
        margin: 4px 0;
    }

    .apps-title {
        margin: 7px 0;
    }

    .app-grid {
        row-gap: 6px;
    }

    .app-icon {
        width: 39px;
        height: 39px;
    }

    .dock {
        padding: 5px 10px;
    }

    .dock button {
        width: 32px;
        height: 32px;
    }
}

@media(prefers-reduced-motion:reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

.system-icons {
    display: flex;
    align-items: center;
    gap: 7px;
}

.system-icons svg {
    width: 19px;
    height: 16px;
    display: block;
}

.lock-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}


/* =========================================
   PROJECT PIHU — FUN ZONE ARCADE
   Consolidated five-game edition
========================================= */

/*
   IMPORTANT:
   These app-window rules only apply when the
   Fun Zone is open. Other apps keep their
   original layout and scrolling behaviour.
*/

.app-window:has(#funZoneArcade) {
    display: flex;
    flex-direction: column;
    height: min(760px, 85dvh);
    max-height: 85dvh;
    min-height: 0;
    overflow: hidden;
}

.app-window:has(#funZoneArcade) > .app-header {
    flex-shrink: 0;
}

.app-content:has(#funZoneArcade) {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}

/* Arcade root */

#funZoneArcade {
    --arcade-ink: #4c3444;
    --arcade-muted: #92798a;
    --arcade-pink: #ed8fb7;
    --arcade-line: rgba(164,111,145,.17);

    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 14px;

    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;

    padding: clamp(14px,2.4vw,22px);

    color: var(--arcade-ink);

    background:
        radial-gradient(
            ellipse at 8% 0%,
            rgba(255,211,228,.48),
            transparent 42%
        ),
        radial-gradient(
            ellipse at 100% 100%,
            rgba(255,226,205,.5),
            transparent 40%
        );
}

#funZoneArcade * {
    box-sizing: border-box;
}

/* Critical: always respect hidden attributes */

#funZoneArcade [hidden] {
    display: none !important;
}

#funZoneArcade button,
#funZoneArcade input,
#funZoneArcade select {
    font: inherit;
}

#funZoneArcade button {
    -webkit-tap-highlight-color: transparent;
}

/* Arcade header */

#funZoneArcade .arcade-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

#funZoneArcade .arcade-eyebrow {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .17em;
    color: #bb7298;
}

#funZoneArcade .arcade-header h2 {
    font-size: clamp(23px,4vw,30px);
    line-height: 1.1;
    margin: 4px 0;
    color: #56394d;
}

#funZoneArcade .arcade-header p {
    font-size: 12px;
    margin: 0;
    color: var(--arcade-muted);
}

#funZoneArcade .arcade-star {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    border-radius: 15px;
    background: rgba(255,255,255,.65);
    border: 1px solid white;
    color: #d77ca8;
    font-size: 25px;
    box-shadow: 0 8px 24px rgba(162,104,139,.1);
}

/* Arcade home */

#funZoneArcade .arcade-home {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

#funZoneArcade .arcade-welcome {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border: 1px solid rgba(255,255,255,.85);
    border-radius: 18px;
    background: rgba(255,255,255,.52);
    backdrop-filter: blur(18px);
}

#funZoneArcade .arcade-welcome > span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 13px;
    background: #ffe5ef;
    color: #d77ca8;
    font-size: 20px;
}

#funZoneArcade .arcade-welcome strong {
    font-size: 13px;
}

#funZoneArcade .arcade-welcome p {
    font-size: 11px;
    margin: 2px 0 0;
    color: var(--arcade-muted);
}

/* Game cards */

#funZoneArcade .arcade-games {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
}

#funZoneArcade .arcade-game-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 116px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 5px;
    padding: 13px;

    border: 1px solid rgba(255,255,255,.9);
    border-radius: 19px;

    text-align: left;
    color: #583f51;
    background: rgba(255,255,255,.62);

    box-shadow: 0 7px 22px rgba(150,104,132,.07);

    cursor: pointer;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}

#funZoneArcade .arcade-game-card:active {
    transform: scale(.975);
}

#funZoneArcade .arcade-game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(150,104,132,.12);
}

#funZoneArcade .game-emoji {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border-radius: 11px;
    background: #ffe5ef;
    color: #c56e98;
    font-size: 19px;
    font-weight: 800;
}

#funZoneArcade .sudoku-card .game-emoji {
    background: #eee7ff;
    color: #8d76c7;
}

#funZoneArcade .reaction-card .game-emoji {
    background: #fff0d9;
    color: #bd8737;
}

#funZoneArcade .word-card .game-emoji {
    background: #e4f4f1;
    color: #559c91;
}

#funZoneArcade .pattern-card .game-emoji {
    background: #e9eaff;
    color: #777bc4;
}

#funZoneArcade .arcade-game-card strong {
    font-size: 12px;
    line-height: 1.2;
}

#funZoneArcade .arcade-game-card small {
    font-size: 10px;
    color: var(--arcade-muted);
    line-height: 1.35;
}

#funZoneArcade .game-play {
    margin-top: auto;
    padding-top: 5px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .12em;
    color: #bd7196;
}

#funZoneArcade .arcade-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 2px 0;
    font-size: 10px;
    color: #a88b9d;
}

/* Game screen */

#funZoneArcade .arcade-game-screen {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
}

#funZoneArcade .arcade-back {
    align-self: flex-start;
    flex-shrink: 0;
    border: 0;
    background: rgba(255,255,255,.6);
    border-radius: 999px;
    padding: 7px 12px;
    color: #986783;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

#funZoneArcade #arcadeGameContent {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#funZoneArcade .arcade-game-panel {
    display: flex;
    height: 100%;
    min-height: 0;
    flex-direction: column;
    gap: 9px;
    overflow: hidden;
}

#funZoneArcade .arcade-game-heading {
    flex-shrink: 0;
}

#funZoneArcade .arcade-game-heading h3 {
    margin: 0;
    font-size: 19px;
    line-height: 1.15;
    color: #56394d;
}

#funZoneArcade .arcade-game-heading p {
    margin: 3px 0 0;
    font-size: 11px;
    color: var(--arcade-muted);
}

/* Score and stats */

#funZoneArcade .arcade-score-row {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 8px;
    flex-shrink: 0;
}

#funZoneArcade .arcade-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,.85);
    border-radius: 13px;
    background: rgba(255,255,255,.55);
}

#funZoneArcade .arcade-stat small {
    font-size: 8px;
    letter-spacing: .12em;
    color: #a98a9d;
    font-weight: 800;
}

#funZoneArcade .arcade-stat strong {
    font-size: 16px;
    color: #68475d;
    font-variant-numeric: tabular-nums;
}

#funZoneArcade .arcade-result {
    display: flex;
    min-height: 34px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    text-align: center;
    font-size: 11px;
    color: #966b83;
    flex-shrink: 0;
}

#funZoneArcade .arcade-result strong {
    font-size: 13px;
    color: #754d68;
}

#funZoneArcade .arcade-result span {
    font-size: 10px;
}

#funZoneArcade .arcade-action {
    border: 0;
    border-radius: 13px;
    padding: 10px 16px;
    background: linear-gradient(135deg,#e99abd,#d989b3);
    color: white;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(205,122,163,.2);
    cursor: pointer;
}

#funZoneArcade .arcade-action.secondary {
    background: rgba(255,255,255,.75);
    color: #986783;
    border: 1px solid var(--arcade-line);
    box-shadow: none;
}

#funZoneArcade .arcade-action:disabled {
    opacity: .55;
    cursor: default;
}

#funZoneArcade .arcade-action-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
}

/* =========================================
   SUDOKU STUDIO
========================================= */

#funZoneArcade .sudoku-toolbar,
#funZoneArcade .memory-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    color: #a17e94;
}

#funZoneArcade .sudoku-level-label,
#funZoneArcade .memory-toolbar label {
    display: flex;
    align-items: center;
    gap: 7px;
}

#funZoneArcade .sudoku-toolbar select,
#funZoneArcade .memory-toolbar select {
    border: 1px solid var(--arcade-line);
    border-radius: 9px;
    padding: 5px 8px;
    background: rgba(255,255,255,.8);
    color: #68475d;
    font-size: 11px;
    letter-spacing: 0;
}

#funZoneArcade .sudoku-time strong,
#funZoneArcade .memory-toolbar strong {
    margin-left: 5px;
    color: #68475d;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

#funZoneArcade .sudoku-stats {
    display: flex;
    justify-content: space-between;
    flex-shrink: 0;
    font-size: 8px;
    letter-spacing: .12em;
    color: #a98a9d;
    font-weight: 800;
}

#funZoneArcade .sudoku-stats strong {
    margin-left: 4px;
    color: #68475d;
    font-size: 11px;
}

#funZoneArcade .sudoku-board-wrap {
    display: flex;
    flex: 1;
    min-height: 0;
    align-items: center;
    justify-content: center;
}

#funZoneArcade .sudoku-board {
    display: grid;
    grid-template-columns: repeat(9,minmax(0,1fr));
    width: min(100%,min(43vh,390px));
    aspect-ratio: 1;
    border: 2px solid #bd8da9;
    border-radius: 7px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 24px rgba(133,88,116,.1);
}

#funZoneArcade .sudoku-cell {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    border-right: 1px solid #eadce5;
    border-bottom: 1px solid #eadce5;
    background: rgba(255,255,255,.93);
    color: #76536b;
    font-size: clamp(12px,2.5vh,19px);
    font-weight: 600;
    cursor: pointer;
}

#funZoneArcade .sudoku-cell.given {
    font-weight: 900;
    color: #513b4c;
    background: #fffafd;
}

#funZoneArcade .sudoku-cell.related {
    background: #f9edf3;
}

#funZoneArcade .sudoku-cell.selected {
    background: #f4cfe0;
    box-shadow: inset 0 0 0 2px #d67da7;
}

#funZoneArcade .sudoku-cell.same-number {
    background: #f5e3ed;
}

#funZoneArcade .sudoku-cell.box-right {
    border-right: 2px solid #bd8da9;
}

#funZoneArcade .sudoku-cell.box-bottom {
    border-bottom: 2px solid #bd8da9;
}

#funZoneArcade .sudoku-notes {
    font-size: clamp(5px,1.1vh,8px);
    letter-spacing: -1px;
    color: #a7839a;
    line-height: 1;
    overflow: hidden;
}

#funZoneArcade .sudoku-tools {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 6px;
    flex-shrink: 0;
}

#funZoneArcade .sudoku-tools button {
    padding: 7px 4px;
    border: 1px solid var(--arcade-line);
    border-radius: 10px;
    background: rgba(255,255,255,.72);
    color: #8c6480;
    font-size: 10px;
    font-weight: 700;
}

#funZoneArcade .sudoku-tools button.active {
    background: #f7dce9;
    border-color: #e5a6c4;
    color: #a4517b;
}

#funZoneArcade .sudoku-numberpad {
    display: grid;
    grid-template-columns: repeat(9,minmax(0,1fr));
    gap: 5px;
    flex-shrink: 0;
}

#funZoneArcade .sudoku-numberpad button {
    min-width: 0;
    padding: 7px 0;
    border: 1px solid rgba(216,169,194,.35);
    border-radius: 9px;
    background: rgba(255,255,255,.82);
    color: #875a76;
    font-size: 14px;
    font-weight: 800;
}

/* =========================================
   REACTION RUSH
========================================= */

#funZoneArcade .reaction-arena {
    display: flex;
    flex: 1;
    min-height: 130px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 22px;
    background: #eee8f4;
    color: #765a78;
    cursor: pointer;
    transition:
        background .18s ease,
        transform .18s ease;
}

#funZoneArcade .reaction-arena span {
    font-size: clamp(26px,6vh,42px);
    font-weight: 900;
}

#funZoneArcade .reaction-arena small {
    font-size: 10px;
    opacity: .8;
}

#funZoneArcade .reaction-arena.waiting {
    background: #f5d9a9;
    color: #8e6429;
}

#funZoneArcade .reaction-arena.go {
    background: #8ed7b2;
    color: #205d42;
    animation: reactionPulse .35s ease;
}

#funZoneArcade .reaction-arena.early {
    background: #f4c6d6;
    color: #8e4666;
}

#funZoneArcade .reaction-arena.done {
    background: #d7d0f2;
    color: #594c8e;
}

@keyframes reactionPulse {
    50% {
        transform: scale(.985);
    }
}

/* =========================================
   MEMORY MATCH 2.0
========================================= */

#funZoneArcade .memory-toolbar {
    justify-content: space-between;
}

#funZoneArcade .memory-board {
    display: grid;
    flex: 1;
    min-height: 0;
    width: min(100%,430px);
    margin: 0 auto;
    grid-template-columns: repeat(4,minmax(0,1fr));
    grid-auto-rows: minmax(0,1fr);
    gap: clamp(5px,1.2vw,9px);
    align-content: center;
}

#funZoneArcade .memory-tile {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 1;
    border: 1px solid rgba(255,255,255,.95);
    border-radius: clamp(9px,2vw,15px);
    background: linear-gradient(
        145deg,
        rgba(255,255,255,.9),
        rgba(246,222,235,.92)
    );
    color: #bd79a0;
    font-size: clamp(18px,4vh,29px);
    box-shadow: 0 4px 12px rgba(150,104,132,.08);
    cursor: pointer;
    transition:
        transform .22s ease,
        background .22s ease;
}

#funZoneArcade .memory-tile span {
    pointer-events: none;
}

#funZoneArcade .memory-tile.flipped {
    background: #fff;
    color: #93627e;
    transform: rotateY(180deg);
}

#funZoneArcade .memory-tile.matched {
    background: #e2f3ec;
    border-color: #b7ddcc;
    color: #4e9b7a;
    opacity: .8;
}

/* =========================================
   WORD RUSH
========================================= */

#funZoneArcade .word-card-panel {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.85);
    border-radius: 20px;
    background: rgba(255,255,255,.56);
}

#funZoneArcade .word-kicker {
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .17em;
    color: #a77b96;
}

#funZoneArcade .word-scramble {
    font-size: clamp(24px,6vw,39px);
    font-weight: 900;
    letter-spacing: .12em;
    color: #72506a;
    text-align: center;
}

#funZoneArcade #wordLength {
    margin: 0;
    color: #a98a9d;
    font-size: 10px;
}

#funZoneArcade .word-form {
    display: flex;
    width: min(100%,370px);
    gap: 7px;
}

#funZoneArcade .word-form input {
    min-width: 0;
    flex: 1;
    border: 1px solid #e8ccdc;
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    color: #65485b;
    text-transform: uppercase;
    font-size: 14px;
    outline: none;
}

#funZoneArcade .word-form button {
    border: 0;
    border-radius: 12px;
    padding: 0 15px;
    background: #d98eb2;
    color: white;
    font-size: 11px;
    font-weight: 800;
}

#funZoneArcade .word-feedback {
    min-height: 17px;
    font-size: 11px;
    color: #986783;
    text-align: center;
}

/* =========================================
   PATTERN BREAKER
========================================= */

#funZoneArcade .pattern-status {
    display: grid;
    flex: 1;
    min-height: 65px;
    place-items: center;
    text-align: center;
    color: #986783;
    font-size: 13px;
}

#funZoneArcade .pattern-pad {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
    width: min(100%,300px);
    margin: 0 auto;
}

#funZoneArcade .pattern-pad button {
    aspect-ratio: 1;
    border: 0;
    border-radius: 22px;
    background: color-mix(
        in srgb,
        var(--tile-color) 26%,
        white
    );
    color: var(--tile-color);
    font-size: clamp(28px,7vh,46px);
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,.8),
        0 7px 17px rgba(120,90,130,.08);
    transition:
        transform .12s ease,
        filter .12s ease;
}

#funZoneArcade .pattern-pad button.lit {
    filter: brightness(1.18) saturate(1.4);
    transform: scale(.94);
    box-shadow:
        0 0 0 4px rgba(255,255,255,.85),
        0 0 24px var(--tile-color);
}

/* =========================================
   ARCADE RESPONSIVE
========================================= */

@media(max-width:520px) {

    #funZoneArcade {
        gap: 10px;
        padding: 12px;
    }

    #funZoneArcade .arcade-games {
        gap: 8px;
    }

    #funZoneArcade .arcade-game-card {
        min-height: 108px;
        padding: 10px;
        border-radius: 16px;
    }

    #funZoneArcade .arcade-game-card strong {
        font-size: 11px;
    }

    #funZoneArcade .arcade-game-card small {
        font-size: 9px;
    }

    #funZoneArcade .arcade-game-panel {
        gap: 7px;
    }

    #funZoneArcade .sudoku-board {
        width: min(100%,min(39vh,360px));
    }

    #funZoneArcade .sudoku-numberpad {
        gap: 3px;
    }

    #funZoneArcade .sudoku-numberpad button {
        padding: 6px 0;
    }
}

@media(max-height:680px) {

    #funZoneArcade {
        gap: 6px;
        padding: 9px;
    }

    #funZoneArcade .arcade-game-panel {
        gap: 5px;
    }

    #funZoneArcade .sudoku-board {
        width: min(100%,min(35vh,330px));
    }

    #funZoneArcade .sudoku-tools button {
        padding: 5px 3px;
    }

    #funZoneArcade .sudoku-numberpad button {
        padding: 4px 0;
    }
}

@media(prefers-reduced-motion:reduce) {

    #funZoneArcade * {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =========================================
   PROJECT PIHU — ARCADE OVERLAP HOTFIX
========================================= */

/* Keep the app window inside the screen */

/* =========================================
   PROJECT PIHU — SUDOKU + PATTERN FIX
   Scoped exclusively to Fun Zone
========================================= */

/* Give Fun Zone more usable screen space */
.app-window:has(#funZoneArcade) {
    width: min(780px, 100%) !important;
    height: min(900px, 92dvh) !important;
    max-height: 92dvh !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.app-window:has(#funZoneArcade) > .app-header {
    flex: 0 0 auto !important;
}

.app-window:has(#funZoneArcade) > .app-content {
    display: flex !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
}

#funZoneArcade,
#funZoneArcade * {
    box-sizing: border-box;
}

#funZoneArcade [hidden] {
    display: none !important;
}

#funZoneArcade .arcade-game-screen {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

#funZoneArcade #arcadeGameContent {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

/* =========================================
   SUDOKU — LARGER BOARD
========================================= */

 
#funZoneArcade .sudoku-board-wrap {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#funZoneArcade .sudoku-board {
    width: min(100%, 480px) !important;
    max-width: min(100%, 480px);
    max-height: 100%;
    aspect-ratio: 1 / 1;
    flex: 0 1 auto;
}

#funZoneArcade .sudoku-cell {
    font-size: clamp(14px, 2.5dvh, 21px);
}

#funZoneArcade .sudoku-numberpad {
    flex: 0 0 auto;
    gap: clamp(3px, .7vw, 7px);
}

#funZoneArcade .sudoku-numberpad button {
    min-height: 34px;
    padding: 7px 0;
    font-size: clamp(12px, 1.8dvh, 16px);
}

#funZoneArcade .sudoku-tools {
    flex: 0 0 auto;
}

#funZoneArcade .sudoku-tools button {
    min-height: 34px;
}

/* =========================================
   PATTERN BREAKER — FIT THE WHOLE GAME
========================================= */

#funZoneArcade .arcade-game-panel:has(.pattern-pad) {
    height: 100%;
    min-height: 0;
    gap: 8px;
    overflow: hidden;
}

/* Status should NOT consume all available space */
#funZoneArcade .pattern-status {
    flex: 0 0 auto !important;
    min-height: 42px !important;
    max-height: 65px;
    padding: 5px 8px;
    font-size: 12px;
}

/* Keep the four pattern buttons together */
#funZoneArcade .pattern-pad {
    flex: 1 1 0 !important;
    min-height: 0 !important;

    width: min(100%, 430px);
    max-width: 430px;

    margin: 0 auto;
    padding: 4px;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: clamp(8px, 1.5vh, 14px);

    overflow: hidden;
}

#funZoneArcade .pattern-pad button {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    aspect-ratio: auto;

    display: grid;
    place-items: center;

    border-radius: clamp(15px, 2.5vw, 25px);
    font-size: clamp(27px, 5dvh, 43px);
}

/* Pattern action controls stay visible */
#funZoneArcade .arcade-game-panel:has(.pattern-pad) .arcade-action-row {
    flex: 0 0 auto;
    min-height: 38px;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 520px) {
    .app-window:has(#funZoneArcade) {
        width: 100% !important;
        height: 94dvh !important;
        max-height: 94dvh !important;
    }

    #funZoneArcade .sudoku-board {
        width: min(100%, 420px) !important;
    }

    #funZoneArcade .pattern-pad {
        width: min(100%, 390px);
    }
}

@media (max-height: 680px) {
     #funZoneArcade .arcade-game-panel:has(.pattern-pad) {
        gap: 5px;
    }

    #funZoneArcade .sudoku-board {
        width: min(100%, 48dvh) !important;
    }

    #funZoneArcade .pattern-status {
        min-height: 32px !important;
    }

    #funZoneArcade .pattern-pad {
        gap: 6px;
    }
}


/* ======================================
   PIHU — BIRTHDAY PASSCODE SCREEN
====================================== */


/* =========================================
   PROJECT PIHU — iOS STYLE PASSCODE SCREEN
========================================= */

#passcodePanel[hidden] {
    display: none !important;
}

#passcodePanel {
    position: absolute;
    inset: 0;
    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px 20px;

    color: white;
    text-align: center;

    background: rgba(35, 25, 35, 0.24);

    backdrop-filter: blur(32px) saturate(150%);
    -webkit-backdrop-filter: blur(32px) saturate(150%);

    animation: passcodeFadeIn .35s ease;
}

.passcode-card {
    width: min(320px, 100%);
    padding: 15px 12px;

    color: white;
    text-align: center;

    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.passcode-icon {
    font-size: 25px;
    margin-bottom: 17px;
    opacity: .9;
}

.passcode-eyebrow {
    display: none;
}

.passcode-card h2 {
    margin: 0 0 9px;

    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    font-size: 25px;
    font-weight: 600;
    letter-spacing: -.5px;
}

.passcode-subtitle {
    margin: 0 auto 30px;
    max-width: 260px;

    font-size: 13px;
    line-height: 1.5;
    font-weight: 400;

    color: rgba(255, 255, 255, .82);
}

/* PASSCODE DOTS */

.passcode-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 19px;

    margin: 0 0 17px;
}

.passcode-dots span {
    width: 11px;
    height: 11px;

    border: 1.4px solid rgba(255, 255, 255, .9);
    border-radius: 50%;

    background: transparent;
    transition: background .18s ease, transform .18s ease;
}

.passcode-dots span.filled {
    background: white;
    transform: scale(1.08);
}

.passcode-message {
    min-height: 19px;
    margin: 0 0 25px;

    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, .82);
}

.passcode-message.success {
    color: #d5ffdf;
}

/* NUMBER KEYPAD */

.passcode-keypad {
    width: 250px;
    max-width: 100%;

    margin: 0 auto;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 13px;
}

.passcode-keypad button {
    width: 100%;
    aspect-ratio: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 50%;

    background: rgba(255, 255, 255, .13);
    color: white;

    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 27px;
    font-weight: 400;

    cursor: pointer;
    -webkit-tap-highlight-color: transparent;

    transition:
        background .15s ease,
        transform .15s ease,
        border-color .15s ease;
}

.passcode-keypad button:active {
    background: rgba(255, 255, 255, .35);
    border-color: rgba(255, 255, 255, .8);
    transform: scale(.91);
}

.passcode-keypad .passcode-hint {
    font-size: 18px;
    font-weight: 500;
}

.passcode-keypad #passcodeDelete {
    font-size: 23px;
    border-color: transparent;
    background: transparent;
}

/* HINT */

.passcode-hint-toggle {
    margin-top: 23px;
    padding: 8px 14px;

    border: none;
    background: transparent;

    color: rgba(255, 255, 255, .92);
    font-size: 13px;
    font-weight: 500;

    cursor: pointer;
}

.passcode-hint-text {
    max-width: 260px;
    margin: 8px auto 0;
    padding: 10px 14px;

    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 15px;

    background: rgba(255, 255, 255, .13);
    color: white;

    font-size: 12px;
    line-height: 1.5;
}

/* ANIMATIONS */

.passcode-error .passcode-card {
    animation: passcodeShake .3s ease;
}

@keyframes passcodeShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes passcodeFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* SMALL SCREENS */

@media (max-height: 650px) {
    .passcode-card {
        transform: scale(.85);
    }

    .passcode-keypad {
        width: 220px;
        gap: 9px;
    }

    .passcode-subtitle {
        margin-bottom: 17px;
    }
}

#unlockArea {
    touch-action: none;
    cursor: pointer;
}


/* =========================================
   PROJECT PIHU — 768 × 1024 DEVICE FIX
========================================= */

@media (min-width: 740px) and (max-width: 800px)
       and (min-height: 950px) and (max-height: 1100px) {

    /* HOME SCREEN */
    .home-content {
        width: 100%;
        max-width: 680px;
        min-height: 0;
        padding: 24px 28px;
        justify-content: center;
    }

    /* WIDGETS */
    .widgets {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .widget {
        min-width: 0;
        padding: 16px;
        border-radius: 22px;
    }

    .birthday-widget,
    .reminder-widget {
        min-height: 155px;
    }

    /* APP GRID */
    .apps-title {
        margin: 25px 0 18px;
    }

    .app-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px 18px;
    }

    .app {
        min-width: 0;
    }

    .app-icon {
        width: 65px;
        height: 65px;
        border-radius: 20px;
        font-size: 28px;
    }

    /* DOCK */
    .dock {
        gap: 19px;
        padding: 12px 20px;
        margin-bottom: 18px;
    }

    .dock button {
        width: 51px;
        height: 51px;
        border-radius: 17px;
        font-size: 25px;
    }

    /* NORMAL APP WINDOWS */
    .app-window:not(:has(#funZoneArcade)) {
        width: min(680px, 100%);
        max-height: 88dvh;
    }

    .app-layer {
        padding: 18px;
    }
}


/* =========================================
   PROJECT PIHU — LAPTOP FIX
   1366 × 768
========================================= */

@media (min-width: 1100px) and (max-width: 1500px)
       and (min-height: 650px) and (max-height: 850px) {

    .home-content {
        max-width: 1120px;
        padding: 8px 35px;
    }

    .welcome {
        margin-bottom: 12px;
    }

    .widgets {
        gap: 14px;
    }

    .birthday-widget,
    .reminder-widget {
        min-height: 125px;
    }

    .widget {
        padding: 15px;
    }

    .apps-title {
        margin: 13px 0 12px;
    }

    .app-grid {
        gap: 12px 20px;
    }

    .app-icon {
        width: 49px;
        height: 49px;
        font-size: 22px;
        border-radius: 15px;
    }

    .dock {
        padding: 8px 15px;
        margin-bottom: 7px;
        gap: 13px;
    }

    .dock button {
        width: 39px;
        height: 39px;
        font-size: 20px;
    }

    .app-layer {
        padding: 12px;
    }

    .app-window:not(:has(#funZoneArcade)) {
        max-height: 90dvh;
    }
}


/* =========================================
   PROJECT PIHU — FUN ZONE LAPTOP OPTIMISATION
   Target: 1366 × 768
   Games only — mobile styles preserved
========================================= */

@media (min-width: 1100px) and (max-width: 1500px)
       and (min-height: 650px) and (max-height: 850px) {

    /* Give the arcade more usable space */

    .app-window:has(#funZoneArcade) {
        width: min(1000px, 94vw) !important;
        height: 94dvh !important;
        max-height: 94dvh !important;
    }

    #funZoneArcade {
        padding: 15px 20px;
        gap: 10px;
    }

    /* Arcade header */

    #funZoneArcade .arcade-header h2 {
        font-size: 27px;
    }

    #funZoneArcade .arcade-header p {
        font-size: 11px;
    }

    /* Game selection screen */

    #funZoneArcade .arcade-home {
        gap: 9px;
    }

    #funZoneArcade .arcade-welcome {
        padding: 9px 13px;
    }

    #funZoneArcade .arcade-games {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    #funZoneArcade .arcade-game-card {
        min-height: 125px;
        padding: 13px;
    }

    #funZoneArcade .game-emoji {
        width: 34px;
        height: 34px;
    }

    /* General game screen */

    #funZoneArcade .arcade-game-screen {
        gap: 7px;
    }

    #funZoneArcade .arcade-game-panel {
        gap: 8px;
    }

    #funZoneArcade .arcade-game-heading h3 {
        font-size: 21px;
    }

    #funZoneArcade .arcade-game-heading p {
        font-size: 11px;
    }

    /* =================================
       SUDOKU — LANDSCAPE LAYOUT
    ================================= */

  
 
    #funZoneArcade .sudoku-board {
        width: min(100%, 62dvh, 510px) !important;
        max-width: 510px;
        max-height: 100%;
        flex: 0 1 auto;
    }

    #funZoneArcade .sudoku-cell {
        font-size: clamp(14px, 2.3dvh, 20px);
    }

    /* =================================
       MEMORY MATCH — BIGGER BOARD
    ================================= */

    #funZoneArcade .memory-board {
        width: min(100%, 620px);
        gap: 10px;
    }

    #funZoneArcade .memory-tile {
        max-width: 125px;
        justify-self: center;
        width: 100%;
        font-size: clamp(22px, 4dvh, 34px);
        border-radius: 17px;
    }

    /* =================================
       REACTION RUSH
    ================================= */

    #funZoneArcade .reaction-arena {
        min-height: 0;
        border-radius: 25px;
    }

    #funZoneArcade .reaction-arena span {
        font-size: 48px;
    }

    /* =================================
       WORD RUSH
    ================================= */

    #funZoneArcade .word-card-panel {
        width: min(100%, 700px);
        margin: 0 auto;
        gap: 15px;
        padding: 20px;
    }

    #funZoneArcade .word-scramble {
        font-size: clamp(34px, 4vw, 48px);
    }

    #funZoneArcade .word-form {
        width: min(100%, 440px);
    }

    /* =================================
       PATTERN BREAKER
    ================================= */

    #funZoneArcade .arcade-game-panel:has(.pattern-pad) {
        gap: 8px;
    }

    #funZoneArcade .pattern-status {
        min-height: 35px !important;
        max-height: 48px;
    }

    #funZoneArcade .pattern-pad {
        width: min(100%, 440px);
        max-width: 440px;
        gap: 12px;
    }

    #funZoneArcade .pattern-pad button {
        font-size: 46px;
        border-radius: 23px;
    }

    /* General controls */

    #funZoneArcade .arcade-action {
        min-height: 36px;
        padding: 9px 18px;
    }
}



 

/* =================================================
   PROJECT PIHU — FINAL FUN ZONE RESPONSIVE LAYOUT
   iPhone SE • Chrome Laptop • Large Laptop
   No vertical scrolling inside Fun Zone
================================================= */

/* ---------- SHARED FUN ZONE CONTAINER ---------- */

.app-window:has(#funZoneArcade) {
    display: flex !important;
    flex-direction: column !important;
    width: min(1000px, 94vw) !important;
    height: 94dvh !important;
    max-height: 94dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.app-window:has(#funZoneArcade) > .app-header {
    flex: 0 0 auto !important;
}

.app-window:has(#funZoneArcade) > .app-content {
    display: flex !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
}

#funZoneArcade {
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

/* No scrolling on the game selection screen either */
#funZoneArcade .arcade-home {
    min-height: 0 !important;
    overflow: hidden !important;
}

/* No scrolling inside any game */
#funZoneArcade .arcade-game-screen,
#funZoneArcade #arcadeGameContent,
#funZoneArcade .arcade-game-panel {
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

/* Always create all 9 Sudoku rows */
#funZoneArcade #sudokuBoard {
    display: grid !important;
    grid-template-columns: repeat(9, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(9, minmax(0, 1fr)) !important;
    gap: 0 !important;
    aspect-ratio: 1 / 1 !important;
    box-sizing: border-box !important;
}

#funZoneArcade #sudokuBoard > .sudoku-cell {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    display: grid !important;
    place-items: center !important;
}

/* =================================================
   LAPTOP — LANDSCAPE SUDOKU
   1366 × 768, including normal Chrome window
================================================= */

@media (min-width: 1100px) {

    .app-window:has(#funZoneArcade) {
        width: min(1000px, 94vw) !important;
        height: 94dvh !important;
        max-height: 94dvh !important;
    }

    #funZoneArcade {
        padding: clamp(10px, 1.5vw, 18px) !important;
        gap: 8px !important;
    }

    #funZoneArcade .arcade-game-screen {
        gap: 6px !important;
    }

    #funZoneArcade .arcade-game-panel:has(#sudokuBoard) {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 245px !important;
        grid-template-rows: auto repeat(6, minmax(0, 1fr)) !important;

        grid-template-areas:
            "heading heading"
            "board toolbar"
            "board stats"
            "board tools"
            "board numbers"
            "board message"
            "board actions" !important;

        align-items: center !important;
        align-content: stretch !important;
        justify-items: stretch !important;

        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        gap: 5px 16px !important;
        overflow: hidden !important;
    }

    #funZoneArcade .arcade-game-panel:has(#sudokuBoard)
    > .arcade-game-heading {
        grid-area: heading !important;
        width: 100% !important;
    }

    #funZoneArcade .sudoku-board-wrap {
        grid-area: board !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    #funZoneArcade #sudokuBoard {
        width: min(100%, 58dvh, 440px) !important;
        max-width: 440px !important;
        max-height: 100% !important;
        flex: 0 1 auto !important;
        aspect-ratio: 1 / 1 !important;
    }

    #funZoneArcade .sudoku-toolbar {
        grid-area: toolbar !important;
        width: 100% !important;
        min-width: 0 !important;
        align-self: center !important;
    }

    #funZoneArcade .sudoku-stats {
        grid-area: stats !important;
        width: 100% !important;
        align-self: center !important;
    }

    #funZoneArcade .sudoku-tools {
        grid-area: tools !important;
        width: 100% !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 5px !important;
        align-self: center !important;
    }

    #funZoneArcade .sudoku-tools button {
        min-width: 0 !important;
        min-height: 34px !important;
        padding: 5px 2px !important;
        font-size: 10px !important;
    }

    #funZoneArcade .sudoku-numberpad {
        grid-area: numbers !important;
        width: 100% !important;
        grid-template-columns: repeat(9, minmax(0, 1fr)) !important;
        gap: 3px !important;
        align-self: center !important;
    }

    #funZoneArcade .sudoku-numberpad button {
        min-width: 0 !important;
        min-height: 34px !important;
        padding: 4px 0 !important;
        font-size: 13px !important;
    }

    #funZoneArcade #sudokuMessage {
        grid-area: message !important;
        width: 100% !important;
        min-height: 0 !important;
        align-self: center !important;
    }

    #funZoneArcade .arcade-game-panel:has(#sudokuBoard)
    > .arcade-action-row {
        grid-area: actions !important;
        width: 100% !important;
        align-self: center !important;
        gap: 6px !important;
    }

    #funZoneArcade .arcade-game-panel:has(#sudokuBoard)
    > .arcade-action-row button {
        min-width: 0 !important;
        min-height: 32px !important;
        padding: 7px 8px !important;
        font-size: 10px !important;
    }
}

/* =================================================
   IPHONE SE + SMALL PHONES — PORTRAIT SUDOKU
================================================= */

@media (max-width: 520px) {

    .app-layer {
        padding: 6px !important;
    }

    .app-window:has(#funZoneArcade) {
        width: 100% !important;
        height: 96dvh !important;
        max-height: 96dvh !important;
        border-radius: 21px !important;
    }

    .app-window:has(#funZoneArcade) > .app-header {
        padding: 10px 12px !important;
    }

    #funZoneArcade {
        padding: 8px !important;
        gap: 6px !important;
    }

    #funZoneArcade .arcade-header {
        gap: 6px !important;
    }

    #funZoneArcade .arcade-header h2 {
        font-size: 22px !important;
    }

    #funZoneArcade .arcade-header p {
        font-size: 10px !important;
    }

    /* Three cards across saves vertical space */
    #funZoneArcade .arcade-games {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 7px !important;
    }

    #funZoneArcade .arcade-game-card {
        min-height: 92px !important;
        padding: 8px !important;
        gap: 4px !important;
    }

    #funZoneArcade .arcade-game-card strong {
        font-size: 10px !important;
    }

    #funZoneArcade .arcade-game-card small {
        font-size: 8px !important;
    }

    #funZoneArcade .game-emoji {
        width: 27px !important;
        height: 27px !important;
        font-size: 16px !important;
    }

    #funZoneArcade .arcade-welcome {
        padding: 8px !important;
        gap: 8px !important;
    }

    #funZoneArcade .arcade-welcome > span {
        width: 30px !important;
        height: 30px !important;
        flex-shrink: 0 !important;
    }

    #funZoneArcade .arcade-footer {
        font-size: 8px !important;
    }

    /* Game layout */
    #funZoneArcade .arcade-game-screen {
        gap: 5px !important;
    }

    #funZoneArcade .arcade-back {
        padding: 5px 10px !important;
        font-size: 10px !important;
    }

    #funZoneArcade .arcade-game-panel:has(#sudokuBoard) {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 4px !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    #funZoneArcade .arcade-game-panel:has(#sudokuBoard)
    > .arcade-game-heading {
        flex: 0 0 auto !important;
    }

    #funZoneArcade .arcade-game-heading h3 {
        font-size: 16px !important;
    }

    #funZoneArcade .arcade-game-heading p {
        font-size: 9px !important;
        margin-top: 2px !important;
    }

    #funZoneArcade .sudoku-toolbar {
        flex: 0 0 auto !important;
        min-height: 25px !important;
        font-size: 8px !important;
    }

    #funZoneArcade .sudoku-toolbar select {
        padding: 3px 5px !important;
        font-size: 10px !important;
    }

    #funZoneArcade .sudoku-time strong {
        font-size: 11px !important;
    }

    #funZoneArcade .sudoku-stats {
        flex: 0 0 auto !important;
        font-size: 7px !important;
    }

    #funZoneArcade .sudoku-stats strong {
        font-size: 9px !important;
    }

    /* Board takes only the space left after controls */
    #funZoneArcade .sudoku-board-wrap {
        display: flex !important;
        flex: 1 1 0 !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    #funZoneArcade #sudokuBoard {
        width: min(100%, 30dvh, 270px) !important;
        max-width: 270px !important;
        max-height: 100% !important;
        flex: 0 1 auto !important;
        aspect-ratio: 1 / 1 !important;
    }

    #funZoneArcade .sudoku-cell {
        font-size: clamp(10px, 2.1dvh, 15px) !important;
    }

    #funZoneArcade .sudoku-tools {
        flex: 0 0 auto !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 4px !important;
    }

    #funZoneArcade .sudoku-tools button {
        min-width: 0 !important;
        min-height: 27px !important;
        padding: 4px 2px !important;
        font-size: 9px !important;
    }

    #funZoneArcade .sudoku-numberpad {
        flex: 0 0 auto !important;
        grid-template-columns: repeat(9, minmax(0, 1fr)) !important;
        gap: 3px !important;
    }

    #funZoneArcade .sudoku-numberpad button {
        min-width: 0 !important;
        min-height: 28px !important;
        padding: 3px 0 !important;
        font-size: 12px !important;
        border-radius: 7px !important;
    }

    #funZoneArcade #sudokuMessage {
        flex: 0 0 auto !important;
        min-height: 23px !important;
        font-size: 9px !important;
    }

    #funZoneArcade .arcade-game-panel:has(#sudokuBoard)
    > .arcade-action-row {
        flex: 0 0 auto !important;
        gap: 6px !important;
    }

    #funZoneArcade .arcade-game-panel:has(#sudokuBoard)
    > .arcade-action-row button {
        min-height: 29px !important;
        padding: 6px 10px !important;
        font-size: 9px !important;
    }
}

/* Extra compact for very short phone viewports */
@media (max-width: 380px) and (max-height: 700px) {

    #funZoneArcade {
        padding: 6px !important;
        gap: 4px !important;
    }

    #funZoneArcade .arcade-game-screen {
        gap: 3px !important;
    }

    #funZoneArcade .arcade-game-panel:has(#sudokuBoard) {
        gap: 3px !important;
    }

    #funZoneArcade #sudokuBoard {
        width: min(100%, 27dvh, 235px) !important;
    }

    #funZoneArcade .sudoku-tools button {
        min-height: 24px !important;
        font-size: 8px !important;
    }

    #funZoneArcade .sudoku-numberpad button {
        min-height: 25px !important;
        font-size: 11px !important;
    }

    #funZoneArcade #sudokuMessage {
        min-height: 19px !important;
    }
}

/* Preserve reduced-motion accessibility */
@media (prefers-reduced-motion: reduce) {
    #funZoneArcade *,
    #funZoneArcade *::before,
    #funZoneArcade *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}



/* =========================================
   PROJECT PIHU — OTHER ARCADE GAMES
   LAPTOP UI FIX — 1366 × 768
   Sudoku intentionally untouched.
========================================= */

@media (min-width: 1100px) and (max-width: 1500px)
       and (min-height: 650px) and (max-height: 850px) {

    /* Shared game layout */
    #funZoneArcade .arcade-game-screen {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
    }

    #funZoneArcade #arcadeGameContent {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
    }

    #funZoneArcade #arcadeGameContent > .arcade-game-panel {
        min-height: 0;
        height: 100%;
        overflow: hidden;
    }

    /* -------------------------------------
       MEMORY MATCH 2.0
       Board on left, controls on right
    ------------------------------------- */

    #funZoneArcade .arcade-game-panel:has(.memory-board) {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 245px;
        grid-template-rows: auto minmax(0, 1fr) auto auto;
        grid-template-areas:
            "heading heading"
            "board toolbar"
            "board result"
            "board actions";
        gap: 10px 22px;
    }

    #funZoneArcade .arcade-game-panel:has(.memory-board) .arcade-game-heading {
        grid-area: heading;
    }

    #funZoneArcade .arcade-game-panel:has(.memory-board) .memory-board {
        grid-area: board;
        width: min(100%, 560px);
        height: 100%;
        max-height: 100%;
        min-height: 0;
        justify-self: center;
        align-self: center;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-rows: repeat(4, minmax(0, 1fr));
        gap: 10px;
    }

    #funZoneArcade .arcade-game-panel:has(.memory-board) .memory-tile {
        width: 100%;
        height: 100%;
        min-height: 0;
        max-width: 125px;
        max-height: 125px;
        aspect-ratio: 1;
        justify-self: center;
        align-self: center;
        font-size: 34px;
    }

    #funZoneArcade .arcade-game-panel:has(.memory-board) .memory-toolbar {
        grid-area: toolbar;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        gap: 12px;
        padding: 15px;
        border-radius: 17px;
    }

    #funZoneArcade .arcade-game-panel:has(.memory-board) #arcadeResult {
        grid-area: result;
        align-self: center;
    }

    #funZoneArcade .arcade-game-panel:has(.memory-board) .arcade-action-row {
        grid-area: actions;
        align-self: center;
    }


    /* -------------------------------------
       REACTION RUSH
       Large reaction arena + compact stats
    ------------------------------------- */

    #funZoneArcade .arcade-game-panel:has(.reaction-arena) {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 245px;
        grid-template-rows: auto minmax(0, 1fr) auto auto;
        grid-template-areas:
            "heading heading"
            "arena score"
            "arena result"
            "arena action";
        gap: 10px 22px;
    }

    #funZoneArcade .arcade-game-panel:has(.reaction-arena) .arcade-game-heading {
        grid-area: heading;
    }

    #funZoneArcade .arcade-game-panel:has(.reaction-arena) .reaction-arena {
        grid-area: arena;
        width: 100%;
        height: 100%;
        min-height: 0;
        max-height: 100%;
        align-self: stretch;
        border-radius: 25px;
    }

    #funZoneArcade .arcade-game-panel:has(.reaction-arena) .reaction-arena span {
        font-size: clamp(38px, 5vw, 64px);
    }

    #funZoneArcade .arcade-game-panel:has(.reaction-arena) .arcade-score-row {
        grid-area: score;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    #funZoneArcade .arcade-game-panel:has(.reaction-arena) #arcadeResult {
        grid-area: result;
        align-self: center;
    }

    #funZoneArcade .arcade-game-panel:has(.reaction-arena) > .arcade-action {
        grid-area: action;
        align-self: center;
        width: 100%;
    }


    /* -------------------------------------
       WORD RUSH
       Word challenge on left, stats on right
    ------------------------------------- */

    #funZoneArcade .arcade-game-panel:has(.word-card-panel) {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 245px;
        grid-template-rows: auto minmax(0, 1fr) auto auto;
        grid-template-areas:
            "heading heading"
            "word score"
            "word result"
            "word action";
        gap: 10px 22px;
    }

    #funZoneArcade .arcade-game-panel:has(.word-card-panel) .arcade-game-heading {
        grid-area: heading;
    }

    #funZoneArcade .arcade-game-panel:has(.word-card-panel) .word-card-panel {
        grid-area: word;
        width: 100%;
        height: 100%;
        min-height: 0;
        max-height: 100%;
        margin: 0;
        padding: 20px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 13px;
    }

    #funZoneArcade .arcade-game-panel:has(.word-card-panel) .word-scramble {
        font-size: clamp(34px, 4vw, 52px);
        letter-spacing: 5px;
    }

    #funZoneArcade .arcade-game-panel:has(.word-card-panel) .word-form {
        width: min(100%, 440px);
    }

    #funZoneArcade .arcade-game-panel:has(.word-card-panel) .arcade-score-row {
        grid-area: score;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    #funZoneArcade .arcade-game-panel:has(.word-card-panel) #arcadeResult {
        grid-area: result;
        align-self: center;
    }

    #funZoneArcade .arcade-game-panel:has(.word-card-panel) > .arcade-action {
        grid-area: action;
        width: 100%;
        align-self: center;
    }


    /* -------------------------------------
       PATTERN BREAKER
       Large 2×2 pad + status panel
    ------------------------------------- */

    #funZoneArcade .arcade-game-panel:has(.pattern-pad) {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 245px;
        grid-template-rows: auto minmax(0, 1fr) auto auto auto;
        grid-template-areas:
            "heading heading"
            "pad score"
            "pad status"
            "pad result"
            "pad action";
        gap: 9px 22px;
    }

    #funZoneArcade .arcade-game-panel:has(.pattern-pad) .arcade-game-heading {
        grid-area: heading;
    }

    #funZoneArcade .arcade-game-panel:has(.pattern-pad) .pattern-pad {
        grid-area: pad;
        width: min(100%, 440px);
        height: 100%;
        max-height: 100%;
        min-height: 0;
        justify-self: center;
        align-self: center;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(0, 1fr));
        gap: 13px;
    }

    #funZoneArcade .arcade-game-panel:has(.pattern-pad) .pattern-pad button {
        width: 100%;
        height: 100%;
        min-height: 0;
        aspect-ratio: auto;
        font-size: clamp(36px, 4vw, 54px);
        border-radius: 24px;
    }

    #funZoneArcade .arcade-game-panel:has(.pattern-pad) .arcade-score-row {
        grid-area: score;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    #funZoneArcade .arcade-game-panel:has(.pattern-pad) .pattern-status {
        grid-area: status;
        min-height: 45px;
        max-height: 75px;
        align-self: center;
    }

    #funZoneArcade .arcade-game-panel:has(.pattern-pad) #arcadeResult {
        grid-area: result;
        align-self: center;
    }

    #funZoneArcade .arcade-game-panel:has(.pattern-pad) > .arcade-action {
        grid-area: action;
        width: 100%;
        align-self: center;
    }


    /* Shared button sizing */
    #funZoneArcade .arcade-game-panel:has(.memory-board) .arcade-action,
    #funZoneArcade .arcade-game-panel:has(.reaction-arena) .arcade-action,
    #funZoneArcade .arcade-game-panel:has(.word-card-panel) .arcade-action,
    #funZoneArcade .arcade-game-panel:has(.pattern-pad) .arcade-action {
        min-height: 39px;
        padding: 9px 15px;
    }
}


/* =========================================
   LAPTOP — NORMAL BROWSER WINDOW FIX
   Accounts for browser tabs and toolbar
========================================= */

@media (min-width: 1100px) and (max-width: 1500px)
       and (min-height: 600px) and (max-height: 850px) {

    .app-window:has(#funZoneArcade) {
        height: 90vh !important;
        height: 90dvh !important;
        max-height: 90vh !important;
        max-height: 90dvh !important;
        width: min(1000px, 94vw) !important;
    }

    .app-window:has(#funZoneArcade) > .app-content {
        min-height: 0 !important;
        overflow: hidden !important;
    }

    #funZoneArcade {
        min-height: 0 !important;
        height: 100% !important;
        padding: 10px 16px !important;
        gap: 8px !important;
    }

    #funZoneArcade .arcade-header {
        flex-shrink: 0;
    }

    #funZoneArcade .arcade-game-screen {
        min-height: 0 !important;
        flex: 1 1 0 !important;
    }

    #funZoneArcade #arcadeGameContent {
        min-height: 0 !important;
        flex: 1 1 0 !important;
    }

    #funZoneArcade .arcade-game-panel {
        min-height: 0 !important;
        gap: 7px !important;
    }
}


/* =====================================
   PIHU'S MATHS NOTES
===================================== */

.math-notes {
    color: #634b5a;
    padding: 5px;
}

.math-notes-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px;
    border-radius: 23px;
    background: linear-gradient(135deg, #fff0f5, #fce5ed, #fff5e9);
    margin-bottom: 20px;
}

.math-notes-icon {
    font-size: 43px;
    width: 65px;
    height: 65px;
    display: grid;
    place-items: center;
    background: #ffffffa8;
    border-radius: 19px;
    flex-shrink: 0;
}

.math-notes-eyebrow {
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #bd7997;
    font-weight: 800;
}

.math-notes-hero h2 {
    font-size: 26px;
    margin: 4px 0;
}

.math-notes-hero p {
    font-size: 13px;
    color: #927486;
}

.math-notes-content {
    display: flex;
    flex-direction: column;
    gap: 19px;
}

.formula-section h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #a65e80;
}

.formula-card {
    background: linear-gradient(145deg, #fff9fc, #fff1f6);
    border: 1px solid #f2dce6;
    border-radius: 17px;
    padding: 15px 17px;
    margin-bottom: 9px;
}

.formula-card strong {
    display: block;
    font-size: 13px;
    color: #b36d8b;
    margin-bottom: 9px;
}

.formula-card p {
    font-size: 14px;
    line-height: 1.8;
    color: #594653;
    overflow-wrap: anywhere;
}

.math-notes-footer {
    padding: 20px 5px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #b47b95;
}

@media(max-width: 650px) {
    .math-notes-hero {
        padding: 16px;
    }

    .math-notes-hero h2 {
        font-size: 22px;
    }

    .formula-card {
        padding: 13px;
    }

    .formula-card p {
        font-size: 13px;
    }
}


/* Notes app icon */
.notes-app-icon {
    background: linear-gradient(145deg, #fff2df, #edc6a9) !important;
}

.notes-app-icon svg {
    width: 34px;
    height: 34px;
    display: block;
    filter: drop-shadow(0 2px 2px rgba(120, 70, 90, .12));
}





/* ==========================================
   PROJECT PIHU — MUSIC PLAYER
   Premium Pink Liquid Glass Styling
========================================== */

.pihu-music {
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    padding: 8px;
    color: #654657;
    font-family: inherit;
}

/* HEADER */

.pihu-music .music-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.pihu-music .music-eyebrow {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #bd829e;
    margin-bottom: 6px;
}

.pihu-music .music-top h2 {
    font-family: Georgia, serif;
    font-size: clamp(25px, 4vw, 32px);
    color: #79536a;
    margin: 0 0 5px;
}

.pihu-music .music-top p {
    font-size: 12px;
    color: #a77d91;
    margin: 0;
}

.pihu-music .music-top-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 17px;
    font-size: 25px;
    color: #bd7898;
    background: rgba(255, 255, 255, .65);
    border: 1px solid rgba(255, 255, 255, .85);
    box-shadow: 0 8px 22px rgba(170, 105, 139, .10);
}

/* MAIN PLAYER CARD */

.pihu-music .music-player-card {
    padding: 22px;
    border-radius: 25px;
    background:
        linear-gradient(145deg,
            rgba(255, 255, 255, .88),
            rgba(255, 235, 243, .82));
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow:
        0 14px 35px rgba(169, 105, 139, .12),
        inset 0 1px 0 rgba(255, 255, 255, .9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ARTWORK */

.pihu-music .music-artwork {
    width: min(190px, 65%);
    aspect-ratio: 1;
    margin: 0 auto 20px;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    border-radius: 25px;
    background:
        radial-gradient(circle at 30% 25%,
            #fff8fc 0%,
            transparent 38%),
        linear-gradient(145deg, #f8c8dc, #e9a9c5 55%, #d99bb8);
    box-shadow:
        0 15px 30px rgba(190, 112, 151, .22),
        inset 0 1px 2px rgba(255, 255, 255, .8);
    transition: transform .35s ease;
}

.pihu-music .music-artwork span {
    font-family: Georgia, serif;
    font-size: 75px;
    color: rgba(255, 255, 255, .92);
    text-shadow: 0 5px 18px rgba(139, 73, 109, .2);
}

.pihu-music .music-artwork.playing {
    transform: scale(1.025);
}

/* SONG INFORMATION */

.pihu-music .music-track-info {
    text-align: center;
    margin-bottom: 22px;
}

.pihu-music .music-track-info h3 {
    margin: 0 0 5px;
    font-family: Georgia, serif;
    font-size: 21px;
    color: #704c60;
}

.pihu-music .music-track-info p {
    margin: 0;
    font-size: 12px;
    color: #ad8296;
}

/* PROGRESS BAR */

.pihu-music .music-progress-area {
    margin-bottom: 17px;
}

.pihu-music #musicProgress {
    display: block;
    width: 100%;
    height: 5px;
    margin: 0;
    cursor: pointer;
    accent-color: #d58eae;
}

.pihu-music .music-time {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    color: #a98596;
}

/* PLAYER CONTROLS */

.pihu-music .music-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin: 18px 0;
}

.pihu-music .music-controls button {
    width: 43px;
    height: 43px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #a76e8b;
    background: rgba(255, 255, 255, .8);
    font-size: 17px;
    transition: transform .2s ease, background .2s ease;
}

.pihu-music .music-controls button:hover {
    transform: scale(1.08);
    background: #fff;
}

.pihu-music .music-controls .music-play-button {
    width: 57px;
    height: 57px;
    font-size: 21px;
    color: white;
    background: linear-gradient(145deg, #e7a9c5, #c77fa2);
    box-shadow: 0 7px 18px rgba(190, 112, 151, .28);
}

/* VOLUME */

.pihu-music .music-volume {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 15px auto 8px;
    max-width: 220px;
    color: #b17c96;
}

.pihu-music #musicVolume {
    width: 100%;
    accent-color: #d58eae;
    cursor: pointer;
}

.pihu-music .music-status {
    min-height: 15px;
    text-align: center;
    font-size: 11px;
    color: #b1849a;
    margin: 10px 0 0;
}

/* PLAYLIST HEADING */

.pihu-music .music-playlist-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 23px 3px 11px;
}

.pihu-music .music-playlist-heading strong {
    font-family: Georgia, serif;
    font-size: 17px;
    color: #79566a;
}

.pihu-music .music-playlist-heading span {
    font-size: 10px;
    color: #b18a9d;
}

/* PLAYLIST */

.pihu-music .music-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pihu-music .music-track {
    width: 100%;
    min-height: 65px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 13px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 16px;
    background: rgba(255, 255, 255, .55);
    color: #78566a;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.pihu-music .music-track:not(:disabled):hover {
    background: rgba(255, 255, 255, .9);
    transform: translateY(-1px);
}

.pihu-music .music-track.active {
    background: linear-gradient(110deg,
        rgba(255, 255, 255, .95),
        rgba(250, 222, 235, .85));
    border-color: rgba(215, 151, 180, .55);
    box-shadow: 0 5px 15px rgba(180, 111, 146, .09);
}

.pihu-music .music-track:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.pihu-music .music-track-number {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(225, 177, 199, .22);
    color: #b77e99;
    font-size: 10px;
    font-weight: 800;
}

.pihu-music .music-track-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pihu-music .music-track-details strong {
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pihu-music .music-track-details small {
    font-size: 10px;
    color: #b18a9d;
}

.pihu-music .music-track-action {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 800;
    color: #bd83a0;
    letter-spacing: .5px;
}

/* FOCUS ACCESSIBILITY */

.pihu-music button:focus-visible,
.pihu-music input:focus-visible {
    outline: 2px solid #c77fa2;
    outline-offset: 3px;
}

/* TABLET */

@media (max-width: 768px) {
    .pihu-music {
        padding: 5px;
    }

    .pihu-music .music-player-card {
        padding: 18px;
    }

    .pihu-music .music-artwork {
        width: min(165px, 60%);
    }
}

/* SMALL PHONES */

@media (max-width: 480px) {
    .pihu-music .music-top {
        margin-bottom: 15px;
    }

    .pihu-music .music-top h2 {
        font-size: 25px;
    }

    .pihu-music .music-top-icon {
        width: 42px;
        height: 42px;
    }

    .pihu-music .music-player-card {
        padding: 16px 13px;
        border-radius: 21px;
    }

    .pihu-music .music-artwork {
        width: 145px;
        border-radius: 20px;
    }

    .pihu-music .music-artwork span {
        font-size: 60px;
    }

    .pihu-music .music-controls {
        gap: 20px;
    }

    .pihu-music .music-track {
        min-height: 59px;
        padding: 9px 10px;
    }
}
/* =================================
   MUSIC ARTWORK WAVE ANIMATION
================================= */

.pihu-music .music-artwork {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* Soft flowing wave layers */
.pihu-music .music-artwork::before,
.pihu-music .music-artwork::after {
    content: "";
    position: absolute;
    left: -50%;
    width: 200%;
    height: 200%;
    border-radius: 40%;
    pointer-events: none;
    opacity: 0;
    transition: opacity .4s ease;
}

.pihu-music .music-artwork::before {
    top: 55%;
    background: rgba(255, 255, 255, .22);
    animation: musicWave 7s linear infinite;
}

.pihu-music .music-artwork::after {
    top: 60%;
    background: rgba(255, 180, 205, .28);
    animation: musicWave 10s linear infinite reverse;
}

/* Animate only while playing */
.pihu-music.is-playing .music-artwork::before,
.pihu-music.is-playing .music-artwork::after {
    opacity: 1;
}

@keyframes musicWave {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pihu-music .music-artwork::before,
    .pihu-music .music-artwork::after {
        animation: none;
    }
}

/* =================================
   FULL MUSIC PLAYER WAVE EFFECT
================================= */

.pihu-music .music-player-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.pihu-music .music-player-card::before,
.pihu-music .music-player-card::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 150%;
    height: 180%;
    left: -25%;
    top: 75%;
    border-radius: 42%;
    pointer-events: none;
    opacity: 0;
    transition: opacity .6s ease, top 1s ease;
}

.pihu-music .music-player-card::before {
    background: rgba(255, 145, 185, .17);
    animation: playerWave 8s linear infinite;
}

.pihu-music .music-player-card::after {
    background: rgba(255, 210, 225, .24);
    animation: playerWave 11s linear infinite reverse;
}

.pihu-music.is-playing .music-player-card::before,
.pihu-music.is-playing .music-player-card::after {
    opacity: 1;
    top: 35%;
}

@keyframes playerWave {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .pihu-music .music-player-card::before,
    .pihu-music .music-player-card::after {
        animation: none;
    }
}

/* Two lock-screen notifications */
.lock-notifications {
    display: grid;
    gap: 10px;
    width: 100%;
}

.lock-notifications .notification {
    width: 100%;
    margin: 0;
}

.notification-countdown {
    cursor: default;
}

/* Floating lock-screen notification cards */
.lock-notifications {
    width: calc(100% - 36px);
    max-width: 420px;
    margin: 0 auto;
    display: grid;
    gap: 10px;
}

.lock-notifications .notification {
    width: 100%;
    min-width: 0;
    margin: 0;
    border-radius: 20px;
    box-sizing: border-box;
}



/* ======================================
   PIHU VOICE NOTES PLAYER
====================================== */

.pihu-voice {
    padding: 18px;
    color: inherit;
}

.voice-top,
.voice-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

.voice-eyebrow {
    font-size: 10px;
    letter-spacing: 2px;
    opacity: .65;
    font-weight: 800;
}

.voice-top h2 {
    font-size: 27px;
    margin: 6px 0;
}

.voice-top p {
    font-size: 12px;
    opacity: .65;
}

.voice-top-icon {
    font-size: 32px;
}

.voice-player-card {
    padding: 24px 18px;
    border-radius: 25px;
    background: linear-gradient(145deg, #f9dce8, #eadcf9);
    color: #51374e;
    text-align: center;
    box-shadow: 0 12px 35px rgba(130, 75, 120, .12);
}

.voice-artwork {
    width: 95px;
    height: 95px;
    margin: 0 auto 17px;
    display: grid;
    place-items: center;
    border-radius: 25px;
    background: linear-gradient(145deg, #e9a8c8, #b69ae7);
    color: white;
    font-size: 43px;
    transition: transform .3s ease;
}

.voice-artwork.playing {
    animation: voicePulse 1.5s ease-in-out infinite;
}

@keyframes voicePulse {
    50% {
        transform: scale(1.06);
    }
}

.voice-track-info h3 {
    font-size: 19px;
    margin-bottom: 5px;
}

.voice-track-info p {
    font-size: 12px;
    opacity: .7;
}

.voice-waveform {
    height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin: 22px 0;
}

.voice-waveform span {
    width: 3px;
    height: 8px;
    border-radius: 10px;
    background: #aa75a8;
    opacity: .65;
}

.voice-waveform.playing span {
    animation: voiceWave .65s ease-in-out infinite alternate;
}

.voice-waveform span:nth-child(3n) {
    animation-delay: -.3s;
}

.voice-waveform span:nth-child(4n) {
    animation-delay: -.5s;
}

.voice-waveform span:nth-child(5n) {
    animation-delay: -.15s;
}

@keyframes voiceWave {
    from { height: 7px; }
    to { height: 35px; }
}

.voice-progress-area {
    margin-top: 15px;
}

#voiceProgress {
    width: 100%;
    accent-color: #a66b9e;
    cursor: pointer;
}

.voice-time {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    opacity: .7;
}

.voice-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin: 22px 0 14px;
}

.voice-controls button {
    border: 0;
    background: transparent;
    color: #654a68;
    font-size: 22px;
    cursor: pointer;
}

.voice-controls .voice-play-button {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: #a66b9e;
    color: white;
    font-size: 23px;
    box-shadow: 0 5px 15px rgba(100, 50, 100, .2);
}

.voice-status {
    font-size: 11px;
    opacity: .7;
}

.voice-list-heading {
    margin: 25px 0 12px;
    font-size: 13px;
}

.voice-list-heading span {
    font-size: 11px;
    opacity: .6;
}

.voice-list {
    display: grid;
    gap: 9px;
}

.voice-track {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px;
    border: 1px solid rgba(160, 120, 160, .13);
    border-radius: 16px;
    background: rgba(180, 140, 180, .07);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: .2s ease;
}

.voice-track.active {
    background: rgba(190, 130, 180, .16);
    border-color: rgba(180, 110, 170, .4);
}

.voice-track-number {
    font-size: 12px;
    opacity: .6;
}

.voice-track-details {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 4px;
}

.voice-track-details strong {
    font-size: 13px;
}

.voice-track-details small {
    font-size: 11px;
    opacity: .6;
}

.voice-track-action {
    font-size: 15px;
    opacity: .7;
}

/* Voice notes stay usable in landscape laptop windows. */
.app-window:has(.pihu-voice) > .app-content {
    overflow-y: auto !important;
}

.pihu-voice {
    width: 100%;
    min-height: 0;
}

@media (min-width: 651px) and (orientation: landscape) {
    .app-window:has(.pihu-voice) {
        height: min(720px, 90dvh) !important;
        max-height: 90dvh !important;
    }

    .pihu-voice {
        height: 100%;
        overflow-y: auto;
        padding: 14px 18px 18px;
        scrollbar-width: thin;
    }

    .pihu-voice .voice-top {
        margin-bottom: 12px;
    }

    .pihu-voice .voice-top h2 {
        margin: 3px 0;
        font-size: 24px;
    }

    .pihu-voice .voice-player-card {
        display: grid;
        grid-template-columns: 105px minmax(0, 1fr);
        grid-template-areas:
            "artwork info"
            "artwork waveform"
            "artwork progress"
            "artwork controls"
            "artwork status";
        align-items: center;
        column-gap: 16px;
        padding: 14px 16px;
    }

    .pihu-voice .voice-artwork {
        grid-area: artwork;
        width: 82px;
        height: 82px;
        margin: 0;
        font-size: 34px;
    }

    .pihu-voice .voice-track-info { grid-area: info; }
    .pihu-voice .voice-track-info h3 {
        margin: 0 0 3px;
        font-size: 16px;
    }
    .pihu-voice .voice-waveform {
        grid-area: waveform;
        height: 30px;
        margin: 7px 0;
    }
    .pihu-voice .voice-progress-area {
        grid-area: progress;
        margin-top: 3px;
    }
    .pihu-voice .voice-controls {
        grid-area: controls;
        margin: 7px 0 4px;
        gap: 22px;
    }
    .pihu-voice .voice-controls .voice-play-button {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    .pihu-voice .voice-status { grid-area: status; margin: 2px 0 0; }
    .pihu-voice .voice-list-heading { margin: 12px 0 8px; }
    .pihu-voice .voice-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }
    .pihu-voice .voice-track {
        min-width: 0;
        padding: 9px 10px;
    }
}
