#tutorial-overlay {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    padding: 22px;
    background: radial-gradient(ellipse at center, rgba(20,70,35,0.55), rgba(9,26,16,0.78));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 45;
}

#tutorial-overlay.open { display: grid; }

.tutorial-card {
    max-width: 430px;
    padding: 22px;
    border: 5px solid #fff3aa;
    border-radius: 22px;
    background: linear-gradient(145deg, #fff9c7, #8cf06f 58%, #35c87a);
    color: #17360e;
    font-family: "Cooper Black", "Comic Sans MS", "Arial Black", sans-serif;
    box-shadow: inset 0 3px 0 rgba(255,255,255,0.75), 0 10px 0 #1b7a31, 0 20px 32px rgba(0,0,0,0.35);
    text-shadow: 1px 1px 0 rgba(255,255,255,0.65);
}

.tutorial-title {
    font-size: 1.55rem;
    line-height: 1;
    margin-bottom: 10px;
}

.tutorial-list {
    margin: 0 0 16px;
    padding-left: 18px;
    font-family: "Arial Black", sans-serif;
    font-size: 0.82rem;
    line-height: 1.35;
}

#tutorial-start {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 12px 14px;
    background: linear-gradient(145deg, #ffffff, #ffe76d);
    color: #3d2508;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.9), 0 5px 0 #986015;
}

#refill-overlay {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    background: radial-gradient(ellipse at center, rgba(8,52,84,0.55), rgba(2,18,32,0.78));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 30;
    animation: refillFadeIn 220ms ease;
}

#refill-overlay.open {
    display: grid;
}

#refill-game {
    position: relative;
    width: min(440px, calc(100vw - 28px));
    height: min(540px, calc(100vh - 60px));
    padding: 18px 18px 16px;
    border: 4px solid #f4fcff;
    border-radius: 26px;
    background:
        radial-gradient(circle at 20% 12%, rgba(255,255,255,0.55), transparent 60%),
        linear-gradient(180deg, #c8f3ff 0%, #6bd4ff 38%, #2a9fdf 78%, #1670ad 100%);
    font-family: "Cooper Black", "Comic Sans MS", "Arial Black", sans-serif;
    color: #07345d;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.65);
    box-shadow: 0 22px 44px rgba(0,0,0,0.42), inset 0 4px 0 rgba(255,255,255,0.85), inset 0 -8px 24px rgba(8,72,116,0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: refillPopIn 360ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.refill-clouds {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.refill-cloud {
    position: absolute;
    background: rgba(255,255,255,0.85);
    border-radius: 999px;
    filter: blur(0.5px);
    box-shadow: 18px 6px 0 -2px rgba(255,255,255,0.85), -16px 4px 0 -2px rgba(255,255,255,0.78);
}

.refill-cloud-a { top: 8%; left: -10%; width: 70px; height: 22px; animation: cloudDrift 14s linear infinite; }

.refill-cloud-b { top: 22%; left: -25%; width: 90px; height: 26px; opacity: 0.75; animation: cloudDrift 22s linear infinite; animation-delay: -6s; }

.refill-cloud-c { top: 4%; left: -40%; width: 55px; height: 18px; opacity: 0.6; animation: cloudDrift 18s linear infinite; animation-delay: -10s; }

.refill-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.refill-title {
    font-size: 1.32rem;
    line-height: 1;
    letter-spacing: 0.5px;
}

.refill-subtitle {
    margin-top: 6px;
    font-size: 0.78rem;
    opacity: 0.86;
}

#refill-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 78px;
    padding: 8px 12px 9px;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #d6f4ff);
    box-shadow: 0 5px 0 #0d69a8, 0 8px 14px rgba(13,105,168,0.4);
    font-size: 0.72rem;
}

.refill-score-label {
    font-size: 0.62rem;
    opacity: 0.68;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.refill-score-value {
    font-size: 1.4rem;
    line-height: 1;
    margin-top: 2px;
}

.refill-score-target {
    font-size: 0.78rem;
    opacity: 0.55;
}

#refill-progress {
    position: relative;
    z-index: 2;
    height: 12px;
    border-radius: 999px;
    background: rgba(7,52,93,0.28);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    overflow: hidden;
}

#refill-progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #6cf2ff, #3ad0ff 50%, #ffd96b);
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.7);
    transition: width 240ms cubic-bezier(0.4,1.5,0.5,1);
}

#refill-playfield {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 280px;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.85);
    border-radius: 18px;
    background:
        radial-gradient(ellipse at 50% 110%, rgba(255,255,255,0.55), transparent 60%),
        linear-gradient(180deg, rgba(140,225,255,0.55), rgba(38,136,200,0.65) 70%, rgba(20,80,130,0.8));
    box-shadow: inset 0 6px 16px rgba(255,255,255,0.35), inset 0 -8px 16px rgba(0,30,60,0.35);
    cursor: crosshair;
}

.refill-3d-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 2;
    border-radius: 15px;
}

.refill-bucket {
    display: none;
    position: absolute;
    left: 50%;
    bottom: 6px;
    transform: translateX(-50%);
    width: 70px;
    height: 32px;
    pointer-events: none;
    z-index: 1;
}

.refill-bucket-rim {
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 8px;
    background: linear-gradient(180deg, #6c4022, #3f2010);
    border-radius: 6px 6px 2px 2px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset;
}

.refill-bucket-water {
    position: absolute;
    left: 4px; right: 4px; top: 6px;
    bottom: 4px;
    background: linear-gradient(180deg, #6dd9ff, #1d8fd0);
    border-radius: 2px 2px 14px 14px;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.6);
    transform-origin: bottom;
    transform: scaleY(var(--bucket-fill, 0.1));
    transition: transform 280ms cubic-bezier(0.4,1.5,0.5,1);
}

.refill-drop {
    position: absolute;
    top: -36px;
    width: 26px;
    height: 34px;
    border: 3px solid #ffffff;
    border-radius: 50% 50% 56% 56% / 60% 60% 50% 50%;
    background: linear-gradient(180deg, #f3ffff 0%, #6ce7ff 50%, #1eaee6 100%);
    cursor: pointer;
    box-shadow: 0 0 16px rgba(180,240,255,0.95), inset 0 -8px 0 rgba(0,93,170,0.22), inset 4px 4px 0 rgba(255,255,255,0.85);
    animation: refillDropFall 2400ms linear forwards;
    transition: transform 80ms ease;
    will-change: transform;
}

.refill-drop::after {
    content: "";
    position: absolute;
    left: 6px; top: 4px;
    width: 6px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
}

.refill-drop:hover { transform: scale(1.1); }

.refill-drop.golden {
    border-color: #fff3a8;
    background: linear-gradient(180deg, #fffbcc 0%, #ffd24d 60%, #f7a81a 100%);
    box-shadow: 0 0 22px rgba(255,225,120,0.95), inset 0 -8px 0 rgba(180,110,0,0.3);
    animation-duration: 1900ms;
}

.refill-drop.mud {
    border-color: #5b3a1a;
    background: radial-gradient(circle at 35% 30%, #a7773f, #5a3617 70%);
    box-shadow: 0 0 8px rgba(60,30,5,0.6), inset 0 -6px 0 rgba(0,0,0,0.3);
    border-radius: 60% 40% 52% 48% / 55% 60% 40% 45%;
    animation-duration: 2200ms;
}

.refill-drop.mud::after { display: none; }

.refill-burst {
    position: absolute;
    pointer-events: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255,255,255,0.9), rgba(120,220,255,0.4) 60%, transparent 70%);
    animation: refillBurst 480ms ease-out forwards;
    z-index: 4;
}

.refill-burst.bad {
    background: radial-gradient(circle, rgba(255,180,160,0.9), rgba(160,80,40,0.5) 60%, transparent 70%);
}

.refill-floater {
    position: absolute;
    pointer-events: none;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    color: #ffffff;
    text-shadow: 0 2px 0 #0a4d7a, 0 0 6px rgba(0,0,0,0.3);
    animation: refillFloat 720ms ease-out forwards;
    z-index: 5;
}

.refill-floater.bad { color: #ffd6c2; text-shadow: 0 2px 0 #5a2210; }

.refill-floater.gold { color: #fff3a8; text-shadow: 0 2px 0 #8a5a00; }

.refill-footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

#refill-combo {
    font-size: 0.78rem;
    color: #ffffff;
    text-shadow: 0 2px 0 #0a4d7a;
    min-height: 1em;
    opacity: 0;
    transition: opacity 200ms;
}

#refill-combo.show { opacity: 1; }

.refill-secondary {
    background: linear-gradient(180deg, #fff, #d8eaf3) !important;
    color: #07345d !important;
}

@keyframes cloudDrift {
    0% { transform: translateX(0); }
    100% { transform: translateX(720px); }
}

/* Paid shop options popup */
#shop-skip-overlay {
    position: fixed;
    inset: 0;
    display: none;
    place-items: start center;
    padding-top: 72px;
    background: radial-gradient(ellipse at center, rgba(40,30,8,0.5), rgba(15,10,2,0.72));
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 33;
}
#shop-skip-overlay.open { display: grid; animation: refillFadeIn 180ms ease; }
#shop-skip-panel {
    position: relative;
    width: min(420px, calc(100vw - 28px));
    padding: 22px 22px 20px;
    border: 4px solid #fff7df;
    border-radius: 24px;
    background:
        radial-gradient(circle at 22% 14%, rgba(255,255,255,0.7), transparent 60%),
        linear-gradient(160deg, #fff5cb 0%, #f0c46a 50%, #c47a2c 100%);
    box-shadow: 0 24px 50px rgba(0,0,0,0.45), inset 0 4px 0 rgba(255,255,255,0.85);
    font-family: "Cooper Black", "Comic Sans MS", "Arial Black", sans-serif;
    color: #3f260f;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.55);
    animation: refillPopIn 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.shop-skip-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 3px solid #fff7df;
    border-radius: 50%;
    background: linear-gradient(180deg, #fff, #f3d499);
    color: #6b3a1a;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 3px 0 #8a4810;
}
.shop-skip-close:hover { filter: brightness(1.06); }
.shop-skip-close:active { transform: translateY(2px); box-shadow: 0 1px 0 #8a4810; }
.shop-skip-header { padding-right: 36px; }
.shop-skip-title { font-size: 1.28rem; line-height: 1; }
.shop-skip-subtitle { margin-top: 6px; font-size: 0.78rem; opacity: 0.86; }
.shop-skip-options { display: grid; gap: 12px; margin-top: 16px; }
.shop-skip-option {
    appearance: none;
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 3px solid rgba(94,58,26,0.34);
    border-radius: 16px;
    background: linear-gradient(160deg, #fffbe8 0%, #ffe6a8 100%);
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.7), 0 4px 0 rgba(124,72,18,0.4);
    color: #3f260f;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 120ms ease, filter 120ms ease;
}
.shop-skip-option:hover { filter: brightness(1.05); }
.shop-skip-option:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255,255,255,0.7), 0 1px 0 rgba(124,72,18,0.4); }
.shop-skip-option:disabled { cursor: not-allowed; opacity: 0.55; filter: grayscale(0.4); }
.shop-skip-option.cooling-down .shop-skip-option-cost { background: rgba(255,255,255,0.5); color: #6b3a1a; font-family: "Courier New", monospace; font-weight: bold; }
.shop-skip-option-skip {
    background: linear-gradient(160deg, #d8f3ff 0%, #79c5ee 100%);
    border-color: rgba(20,80,130,0.4);
    color: #07345d;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.7), 0 4px 0 #1670ad;
}
.shop-skip-option-boost {
    background: linear-gradient(160deg, #fff0d8 0%, #ffb147 50%, #ff7ab8 100%);
    border-color: rgba(115,40,80,0.4);
    color: #4a1c2c;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.7), 0 4px 0 #a13d6a;
}
.shop-skip-option-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.55);
    font-size: 1.2rem;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.8);
}
.shop-skip-option-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.shop-skip-option-title { font-size: 1rem; line-height: 1; }
.shop-skip-option-desc { font-size: 0.72rem; opacity: 0.78; line-height: 1.2; white-space: normal; }
.shop-skip-option-cost {
    padding: 7px 11px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.78);
    color: #3a1f08;
    font-size: 0.86rem;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 2px 0 rgba(0,0,0,0.18);
    white-space: nowrap;
}
#shop-skip-status {
    margin-top: 12px;
    min-height: 1.2em;
    font-size: 0.82rem;
    color: #4a2c00;
    text-align: center;
}
#shop-skip-status.success { color: #1e6a26; }
#shop-skip-status.error { color: #a8321a; }

/* Live shop ticker (shows recent purchases under the timer) */
#shop-ticker {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    z-index: 4;
    max-width: min(420px, calc(100vw - 32px));
}
.shop-ticker-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 7px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,247,213,0.92));
    color: #3f260f;
    font-family: "Cooper Black", "Comic Sans MS", "Arial Black", sans-serif;
    font-size: 0.74rem;
    line-height: 1;
    box-shadow: 0 4px 0 rgba(124,72,18,0.4), 0 6px 12px rgba(0,0,0,0.18);
    text-shadow: 1px 1px 0 rgba(255,255,255,0.65);
    animation: shopTickerIn 320ms ease both, shopTickerOut 360ms ease 4400ms both;
    max-width: 100%;
}
.shop-ticker-entry .shop-ticker-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 0 rgba(0,0,0,0.25);
}
.shop-ticker-entry.skip {
    background: linear-gradient(180deg, #d8f3ff, #a4d8f1);
    color: #07345d;
}
.shop-ticker-entry.boost {
    background: linear-gradient(180deg, #fff0d8, #ffc7eb);
    color: #4a1c2c;
}
@keyframes shopTickerIn {
    0% { opacity: 0; transform: translateY(-10px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes shopTickerOut {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-12px) scale(0.92); }
}

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

@keyframes refillPopIn {
    0% { transform: scale(0.6) translateY(40px); opacity: 0; }
    60% { transform: scale(1.05) translateY(-4px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes refillBurst {
    0% { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2.4); opacity: 0; }
}

@keyframes refillFloat {
    0% { transform: translate(-50%, -50%) translateY(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) translateY(-30px); opacity: 0; }
}

#scroll-jump {
    position: fixed;
    left: 18px;
    bottom: 18px;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 4px solid #ffffff;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffec8b, #f7a81a);
    color: #4a2900;
    font-family: "Cooper Black", "Comic Sans MS", "Arial Black", sans-serif;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 5px 0 #8a4810, 0 10px 18px rgba(0,0,0,0.34), inset 0 2px 0 rgba(255,255,255,0.7);
    opacity: 0;
    transform: translateY(8px) scale(0.9);
    pointer-events: none;
    transition: opacity 200ms ease, transform 220ms cubic-bezier(0.34,1.56,0.64,1);
    z-index: 6;
    user-select: none;
}

#scroll-jump.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

#scroll-jump:hover { filter: brightness(1.06); }

#scroll-jump:active {
    transform: translateY(3px) scale(0.96);
    box-shadow: 0 2px 0 #8a4810, 0 4px 8px rgba(0,0,0,0.3), inset 0 2px 0 rgba(255,255,255,0.6);
}

#scroll-jump::before {
    content: "▲";
    display: block;
}

#scroll-jump.down::before {
    content: "▼";
}

#account-button {
    position: fixed;
    left: 82px;
    bottom: 21px;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 4px solid #ffffff;
    border-radius: 50%;
    background: linear-gradient(180deg, #e9fff2, #62d87a);
    color: #173514;
    cursor: pointer;
    box-shadow: 0 5px 0 #1e7430, 0 10px 18px rgba(0,0,0,0.32), inset 0 2px 0 rgba(255,255,255,0.75);
    z-index: 6;
    pointer-events: auto;
    user-select: none;
    transition: transform 180ms ease, filter 180ms ease;
}

#account-button.guest {
    background: linear-gradient(180deg, #ffb7b7, #e43838);
    color: #fff7d8;
    box-shadow: 0 5px 0 #8b1515, 0 10px 18px rgba(0,0,0,0.32), 0 0 18px rgba(255,38,38,0.85), inset 0 2px 0 rgba(255,255,255,0.78);
    animation: accountGuestPulse 1250ms ease-in-out infinite;
}

#account-button:hover { filter: brightness(1.07); }

#account-button:active { transform: translateY(3px) scale(0.95); }

.account-icon {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
}

.account-icon::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 8px;
    width: 10px;
    height: 10px;
    border: 3px solid currentColor;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
}

.account-icon::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 24px;
    width: 22px;
    height: 10px;
    border: 3px solid currentColor;
    border-radius: 999px 999px 8px 8px;
    background: rgba(255,255,255,0.35);
}

#account-button.guest .account-icon::before {
    content: "!";
    left: 0;
    top: 2px;
    width: 100%;
    height: auto;
    border: 0;
    background: transparent;
    color: #fff7d8;
    font-family: "Cooper Black", "Comic Sans MS", "Arial Black", sans-serif;
    font-size: 1.55rem;
    line-height: 1;
    text-align: center;
    text-shadow: 2px 2px 0 #7a1111;
}

#account-button.guest .account-icon::after {
    left: 11px;
    top: 27px;
    width: 18px;
    height: 5px;
    border: 0;
    border-radius: 999px;
    background: #fff7d8;
    box-shadow: 1px 2px 0 #7a1111;
}

#plot-owner-banner {
    position: fixed;
    left: 50%;
    top: 18px;
    transform: translate(-50%, -14px) scale(0.94);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 190px;
    max-width: min(440px, calc(100vw - 32px));
    padding: 10px 16px;
    border: 4px solid #fff7df;
    border-radius: 18px;
    background: linear-gradient(180deg, #fff3a8, #f0a32a);
    color: #442406;
    font-family: "Cooper Black", "Comic Sans MS", "Arial Black", sans-serif;
    font-size: 0.92rem;
    line-height: 1.08;
    text-shadow: 0 1px 0 rgba(255,255,255,0.45);
    box-shadow: 0 6px 0 #9c5418, 0 12px 24px rgba(0,0,0,0.28), inset 0 2px 0 rgba(255,255,255,0.7);
    opacity: 0;
    pointer-events: none;
    z-index: 12;
    transition: opacity 170ms ease, transform 190ms cubic-bezier(0.34,1.56,0.64,1);
    box-sizing: border-box;
}

#plot-owner-banner.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

#plot-owner-color {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    background: #8b5a2b;
    box-shadow: 0 2px 0 rgba(80,42,8,0.35);
}

#plot-owner-name {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

@keyframes accountGuestPulse {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-2px) scale(1.05); }
}

#account-overlay {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    z-index: 37;
    background: radial-gradient(ellipse at center, rgba(33,18,8,0.5), rgba(8,4,2,0.76));
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#account-overlay.open {
    display: grid;
    animation: refillFadeIn 180ms ease;
}

#account-panel {
    width: min(390px, calc(100vw - 28px));
    padding: 18px;
    border: 4px solid #fff7df;
    border-radius: 24px;
    background:
        radial-gradient(circle at 20% 15%, rgba(255,255,255,0.75), transparent 48%),
        linear-gradient(155deg, #fff1b0 0%, #ffc857 48%, #d96a3a 100%);
    box-shadow: 0 22px 48px rgba(0,0,0,0.45), inset 0 4px 0 rgba(255,255,255,0.8);
    color: #3e2109;
    font-family: "Cooper Black", "Comic Sans MS", "Arial Black", sans-serif;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.58);
    animation: refillPopIn 300ms cubic-bezier(0.34,1.56,0.64,1);
}

.account-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.account-title { font-size: 1.22rem; line-height: 1; }

.account-subtitle { margin-top: 5px; font-size: 0.74rem; opacity: 0.86; }

.account-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.account-tab,

.account-action,

.account-close {
    appearance: none;
    border: 0;
    border-radius: 13px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #fff, #ffe6a8);
    color: #3e2109;
    cursor: pointer;
    font-family: inherit;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.72), 0 4px 0 #8a4810;
}

.account-tab.active {
    background: linear-gradient(180deg, #d8ff78, #39d65c);
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.75), 0 4px 0 #16712f;
}

.account-close {
    padding: 8px 10px;
    font-size: 0.72rem;
}

.account-form {
    display: grid;
    gap: 9px;
}

.account-field {
    display: grid;
    gap: 5px;
    font-size: 0.68rem;
    text-transform: uppercase;
}

.account-field input {
    min-width: 0;
    padding: 11px 12px;
    border: 3px solid rgba(88,45,12,0.28);
    border-radius: 14px;
    background: rgba(255,255,255,0.78);
    color: #2a1606;
    font-family: "Arial Black", sans-serif;
    font-size: 0.86rem;
    outline: none;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.68);
}

.account-field input:focus {
    border-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.26), inset 0 2px 0 rgba(255,255,255,0.8);
}

.account-action {
    margin-top: 4px;
    background: linear-gradient(180deg, #ffd55a, #e08a1b);
}

.account-action.danger {
    background: linear-gradient(180deg, #ffb7b7, #e43838);
    color: #fff8dc;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.65), 0 4px 0 #8b1515;
}

.account-action.secondary {
    background: linear-gradient(180deg, #ffffff, #dff1e2);
    color: #235127;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.85), 0 4px 0 #43803d;
}

.account-message {
    min-height: 1.1em;
    color: #76220f;
    font-family: "Arial Black", sans-serif;
    font-size: 0.68rem;
    line-height: 1.2;
}

.account-profile {
    display: grid;
    gap: 10px;
}

.account-name-card {
    padding: 13px;
    border: 3px solid rgba(88,45,12,0.22);
    border-radius: 16px;
    background: rgba(255,255,255,0.54);
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.65);
}

.account-name {
    display: block;
    font-size: 1.08rem;
    line-height: 1;
}

.account-save-note {
    display: block;
    margin-top: 6px;
    font-family: "Arial Black", sans-serif;
    font-size: 0.66rem;
    line-height: 1.2;
    opacity: 0.78;
    text-transform: uppercase;
}
