@font-face {
    font-family: 'pixel';
    src: url('../assets/font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
html {
    /* PRO_Stumblr thank you! */
    /*background: url(table-cloth.jpg);*/
    /* background: url(assets/cookie.png); <- put this into the body*/ /* OmG-bt9rm thank you! */
    text-align: center;
    /* ElLeonelGD thank you! */
    font-family: 'pixel', 'Helvetica Neue';
    /*font-weight: 200;*/
}
#cookies {
    color: #6b2f00;
    position: relative;
    display: inline-block;
    font-variant-numeric: tabular-nums;
}
h1 {
    background-color: rgba(255,255,255,0.8);
    color: #7b3f00;
    font-size: 50px;
}
button#cookie {
    cursor: pointer;
    width: 40vh;
    height: 40vh;
    border-radius: 50%;
    border: 0;
    background-color: rgba(255, 255, 215, 0.3);
    padding: 2vh;
    box-sizing: border-box;
    outline: none;
}

button#cookie img {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

  
button#cookie {
    transition: all 0.1s ease;
    position: relative;
}
button#cookie img {
    --skin-filter: brightness(1);
    object-fit: contain;
    animation: cookie-breathe 3s ease-in-out infinite;
    filter: drop-shadow(0 1.5vh 1.5vh rgba(90, 40, 0, 0.35));
    transition: filter 0.15s ease;
}
button#cookie img {
    filter: var(--skin-filter) var(--tint, brightness(1)) drop-shadow(0 1.5vh 1.5vh rgba(90, 40, 0, 0.35));
    transition: filter 2s ease;
}
button#cookie:hover img {
    filter: drop-shadow(0 1.5vh 2vh rgba(90, 40, 0, 0.45)) brightness(1.08);
}
button#cookie:active img {
    transform: scale(0.82);
    filter: drop-shadow(0 0.5vh 0.8vh rgba(90, 40, 0, 0.5)) brightness(0.9);
    animation: none;
}
button#cookie::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
}
button#cookie.pressed::after {
    animation: flash 0.4s ease-out;
}
button#cookie.pressed img {
    animation: press 0.35s cubic-bezier(.2, 1.6, .4, 1);
}
@keyframes cookie-breathe {
    50% { transform: scale(1.04) translateY(-1%); }
}
@keyframes press {
    0% { transform: scale(1); filter: brightness(1); }
    15% { transform: scale(0.7, 0.8) rotate(-8deg); filter: brightness(1.6) saturate(1.4); }
    55% { transform: scale(1.18, 1.08) rotate(4deg); filter: brightness(1.25); }
    100% { transform: scale(1); filter: brightness(1); }
}
@keyframes flash {
    0% { box-shadow: 0 0 0 0 rgba(255, 230, 120, 0.9), 0 0 40px 10px rgba(255, 210, 90, 0.9); background-color: rgba(255, 240, 160, 0.6); }
    100% { box-shadow: 0 0 0 5vh rgba(255, 230, 120, 0), 0 0 0 0 rgba(255, 210, 90, 0); }
}
.click-ring {
    position: fixed;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 6px solid rgba(255, 220, 120, 0.95);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999;
    animation: click-ring 0.5s ease-out forwards;
}
@keyframes click-ring {
    to { transform: scale(4); opacity: 0; border-width: 1px; }
}
.click-crumb {
    position: fixed;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    background: url("../assets/cookie_crumb.png") no-repeat center / contain;
    pointer-events: none;
    z-index: 1000;
    animation: click-crumb 0.6s ease-out forwards;
}
@keyframes click-crumb {
    to { transform: translate(var(--dx), var(--dy)) scale(0.3); opacity: 0; }
}
.click-number {
    position: fixed;
    pointer-events: none;
    z-index: 1001;
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 4px #7b3f00, 0 2px 0 #7b3f00, 0 0 10px #ffd35a;
    transform: translateX(-50%);
    animation: click-number 0.9s ease-out forwards;
}
@keyframes click-number {
    from { transform: translate(-50%, 0) scale(0.6); opacity: 1; }
    20% { transform: translate(-50%, -20px) scale(1.2); }
    to { transform: translate(-50%, -90px) scale(1); opacity: 0; }
}

body, img {
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

.click-pop {
    position: fixed;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    background: url("../assets/cookie.png") no-repeat center / contain;
    pointer-events: none;
    z-index: 1000;
    animation: click-pop 0.7s ease-out forwards;
}
@keyframes click-pop {
    from { transform: translateY(0) rotate(0) scale(0.6); opacity: 1; }
    to { transform: translateY(-80px) rotate(var(--r)) scale(1.1); opacity: 0; }
}
  
button#cookie:active, button#cookie:focus{
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

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

button#cookie {
    animation: resize 30s infinite linear;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: lightblue;
    background-color: #A7775B; /* @YukiMasterGD */
}
/* * { margin: 0; padding: 0; box-sizing: border-box; } body { min-height: 100vh; background: linear-gradient(90deg, #ADD8E6 16px, #DDA0DD 16px, #DDA0DD 32px), linear-gradient(#ADD8E6 16px, #DDA0DD 16px, #DDA0DD 32px); background-size: 32px 32px; background-position: 0 0; image-rendering: pixelated; image-rendering: crisp-edges; }*/


#layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    grid-template-columns: 1fr 3fr 1fr;
}
.grid-element {
    display: grid;
    grid-auto-flow: column;
    gap: 1rem;
}

#chat-column {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 0;
}
#leaderboard, #click-leaderboard {
    flex: none; /* always visible at the top of the column */
    margin: 0.5rem 0.5rem 0;
    padding: 0.5rem 0.7rem;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 24px rgba(80, 40, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border-radius: 0.5rem;
}
#leaderboard ol, #click-leaderboard ol {
    margin: 0.3rem 0 0;
    padding-left: 1.4rem;
    font-size: 0.85em;
}
#leaderboard ol:empty::before, #click-leaderboard ol:empty::before {
    content: 'Nobody yet';
    margin-left: -1.4rem;
    opacity: 0.6;
}
#instructions {
    margin: 0 0.5rem 0.5rem;
    padding: 0.5rem 0.7rem;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 24px rgba(80, 40, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border-radius: 0.5rem;
    font-size: 0.8em;
    flex: 0 1 auto;
    overflow: hidden;
}
#instructions ul { padding-left: 1.1rem; }
#versus { color: #7b1fa2; min-height: 1.2em; }
#chat {
    display: block;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.5rem;
    box-sizing: border-box;
}
#chat .chat {
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 24px rgba(80, 40, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border-radius: 0.5rem;
    margin-bottom: 0.4rem;
    padding: 0.4rem 0.6rem;
    overflow-wrap: anywhere;
}
#chat .chat-user {
    color: #7a3e00;
}

html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
}

@keyframes bg-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.bg-cookie {
    position: fixed;
    z-index: -1;
    pointer-events: none;
    background: url("../assets/cookie.png") no-repeat center / contain;
    width: var(--s);
    height: var(--s);
    left: calc((100vw - var(--s)) * var(--x));
    top: calc((100vh - var(--s)) * var(--y));
    animation: bg-spin 60s infinite linear;
}
.bg-cookie:nth-child(1) { --s: 160px; --x: 0.12; --y: 0.15; }
.bg-cookie:nth-child(2) { --s: 140px; --x: 0.95; --y: 0.21; }
.bg-cookie:nth-child(3) { --s: 130px; --x: 0.89; --y: 0.85; }
.bg-cookie:nth-child(4) { --s: 110px; --x: 0.14; --y: 0.91; }
.bg-cookie:nth-child(5) { --s: 95px; --x: 0.07; --y: 0.55; }
.bg-cookie:nth-child(6) { --s: 90px; --x: 0.98; --y: 0.59; }
.bg-cookie:nth-child(7) { --s: 75px; --x: 0.32; --y: 0.13; }
.bg-cookie:nth-child(8) { --s: 70px; --x: 0.72; --y: 0.94; }

.golden-cookie {
    position: fixed;
    width: 80px;
    height: 80px;
    padding: 0;
    border: 0;
    background: url(../assets/cookie.png) center / contain no-repeat;
    filter: sepia(1) saturate(6) hue-rotate(-5deg) brightness(1.3) drop-shadow(0 0 12px gold);
    cursor: pointer;
    z-index: 20;
    animation: golden-pulse 0.8s ease-in-out infinite alternate, golden-fade 0.4s ease-out;
}

.golden-cookie.diamond-cookie {
    filter: sepia(1) saturate(5) hue-rotate(150deg) brightness(1.4) drop-shadow(0 0 14px cyan);
}

.golden-cookie.cheese-cookie {
    background: none;
    filter: drop-shadow(0 0 14px #ffd23f);
    font-size: 64px;
    line-height: 80px;
    text-align: center;
}

.golden-cookie.leaving {
    transition: opacity 0.4s, transform 0.4s;
    opacity: 0;
    transform: scale(0.2);
}

.golden-bonus {
    position: fixed;
    color: gold;
    font-size: 32px;
    font-weight: bold;
    text-shadow: 0 0 4px #000;
    pointer-events: none;
    z-index: 21;
    animation: golden-rise 1.2s ease-out forwards;
}

@keyframes golden-pulse { from { scale: 0.9; } to { scale: 1.1; } }
@keyframes golden-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes golden-rise { to { transform: translateY(-80px); opacity: 0; } }

.attack-cookie {
    position: fixed;
    width: 60px;
    height: 60px;
    padding: 0;
    border: 0;
    background: url(../assets/cookie.png) center / contain no-repeat;
    filter: grayscale(1) brightness(0.45) sepia(1) saturate(8) hue-rotate(-50deg) drop-shadow(0 0 10px red);
    cursor: crosshair;
    z-index: 20;
    transition: left var(--t) linear, top var(--t) linear;
    animation: attack-spin 0.6s linear infinite;
}

.attack-bonus {
    position: fixed;
    color: #f33;
    font-size: 32px;
    font-weight: bold;
    text-shadow: 0 0 4px #000;
    pointer-events: none;
    z-index: 21;
    animation: golden-rise 1.2s ease-out forwards;
}

@keyframes attack-spin { to { rotate: 360deg; } }

.boss-cookie {
    position: fixed;
    width: 180px;
    height: 180px;
    padding: 0;
    border: 0;
    background: url(../assets/cookie.png) center / contain no-repeat;
    filter: hue-rotate(250deg) saturate(2) brightness(0.7) drop-shadow(0 0 20px purple);
    cursor: crosshair;
    z-index: 20;
    animation: boss-wobble 0.5s ease-in-out infinite alternate;
}

.boss-cookie.hit {
    filter: hue-rotate(250deg) saturate(2) brightness(2) drop-shadow(0 0 20px red);
}

.boss-bar {
    position: fixed;
    width: 180px;
    height: 14px;
    border: 2px solid #000;
    background: #400;
    z-index: 21;
    pointer-events: none;
}

.boss-bar > div {
    height: 100%;
    width: 100%;
    background: #e22;
}

.boss-bar::after {
    content: attr(data-label);
    position: absolute;
    top: -22px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 4px #000;
}

@keyframes boss-wobble { from { rotate: -6deg; } to { rotate: 6deg; } }

#shop {
    max-height: 100vh;
    overflow-y: auto;
    padding: 0.5rem;
    box-sizing: border-box;
}
#shop h2 {
    background-color: rgba(255,255,255,0.8);
    color: #7b3f00;
    margin: 0 0 0.5rem;
}
.upgrade {
    display: block;
    width: 100%;
    margin-bottom: 0.4rem;
    padding: 0.5rem 0.6rem;
    text-align: left;
    font: inherit;
    color: #7a3e00;
    background: rgba(255, 255, 255, 0.85);
    border: 0;
    border-radius: 0.5rem;
    cursor: pointer;
}
.upgrade:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.upgrade:not(:disabled):hover {
    background: #fff3c4;
}
.upgrade .upgrade-desc {
    display: block;
    font-size: 0.8em;
}
#shop h2:not(:first-child) {
    margin-top: 1rem;
}
.achievement {
    margin-bottom: 0.4rem;
    padding: 0.4rem 0.6rem;
    color: #7a3e00;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0.5rem;
    opacity: 0.6;
}
.achievement.unlocked {
    background: #fff3c4;
    opacity: 1;
    font-weight: bold;
}

/* Rotating starburst glow behind the big cookie and golden cookies */
button#cookie::before,
.golden-cookie::before {
    content: "";
    position: absolute;
    inset: -45%;
    z-index: -1;
    pointer-events: none;
    background: repeating-conic-gradient(rgba(255, 230, 120, 0.75) 0deg 10deg, transparent 10deg 30deg);
    -webkit-mask: radial-gradient(circle, #000 25%, transparent 70%);
    mask: radial-gradient(circle, #000 25%, transparent 70%);
    animation: glow-spin 12s linear infinite;
}
.golden-cookie::before {
    inset: -70%;
    animation-duration: 6s;
}
@keyframes glow-spin { to { transform: rotate(360deg); } }

#cookie-speech {
    position: fixed;
    width: 30vw;
    min-width: 220px;
    max-width: 420px;
    padding: 0.6rem 0.8rem;
    box-sizing: border-box;
    transform: translateX(-50%);
    text-align: left;
    color: #5a2d00;
    background: #fffbe8;
    border: 3px solid #7b3f00;
    border-radius: 1rem;
    pointer-events: none;
    z-index: 15;
    opacity: 0;
    transition: opacity 0.4s;
}
#cookie-speech.visible { opacity: 1; }
#cookie-speech::before {
    content: "";
    position: absolute;
    top: -14px;
    left: calc(50% - 10px);
    border: 10px solid transparent;
    border-top: 0;
    border-bottom: 12px solid #7b3f00;
}
#cookie-speech strong { display: block; margin-bottom: 0.2rem; }

.water-glass {
    position: fixed;
    width: 44px;
    height: 64px;
    padding: 0;
    border: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.35) 0 18%, #fffefa 18% 30%, #f6f2e9 30% 100%);
    clip-path: polygon(0 0, 100% 0, 84% 100%, 16% 100%);
    cursor: pointer;
    z-index: 20;
    filter: drop-shadow(0 0 6px #fff);
    animation: golden-fade 0.4s ease-out;
}

#kevin {
    position: fixed;
    left: 12px;
    bottom: 12px;
    max-width: 240px;
    padding: 0.6rem 0.8rem;
    background: #fff8e6;
    color: #3b2200;
    border: 2px solid #7b3f00;
    border-radius: 10px;
    z-index: 22;
    animation: golden-fade 0.4s ease-out;
}
#kevin strong { display: block; margin-bottom: 0.2rem; }

#buff { color: #1a6fd1; min-height: 1.2em; }

.boss-cookie.irs {
    filter: grayscale(1) brightness(0.8) contrast(1.4) drop-shadow(0 0 20px #3a6ea5);
}
.boss-cookie.irs.hit {
    filter: grayscale(1) brightness(2) drop-shadow(0 0 20px #fff);
}

#hack-panel {
    position: fixed;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    display: none;
    flex-wrap: wrap;
    gap: 0.3rem;
    max-width: 90vw;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 0.5rem;
    z-index: 100;
    font-size: 14px;
}
#hack-panel.open { display: flex; }
#hack-panel button, #hack-panel input {
    font: inherit;
    padding: 0.2rem 0.5rem;
}
#hack-panel .hack-title { width: 100%; color: #0f0; text-align: left; }

#hydrate-alert {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(10, 132, 255, 0.35);
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    text-shadow: 0 2px 10px rgba(0, 40, 100, 0.6);
    color: #fff;
    font-size: 8vw;
    font-weight: bold;
    text-align: center;
    z-index: 1000;
}
#hydrate-alert.open { display: flex; }

/* Versus team members get their team color on name and text */
#chat .chat.team-red, #chat .chat.team-red .chat-user { color: #d62828; }
#chat .chat.team-blue, #chat .chat.team-blue .chat-user { color: #1d4ed8; }

.chat-emoji {
    position: fixed;
    z-index: 50;
    pointer-events: none;
    line-height: 1;
    user-select: none;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
}

#players { color: #7b3f00; font-size: 1rem; min-height: 1.2em; }
#reactions {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.8rem;
}
#reactions button {
    font-size: 1.6rem;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 0.8rem;
    transition: transform 0.12s;
}
#reactions button:hover { transform: scale(1.2); }
#reactions button:active { transform: scale(0.9); }

#chess {
    margin: 0 0 1rem;
    padding: 0.5rem 0.7rem;
    box-sizing: border-box;
    text-align: center;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 0.8rem;
}
.chess-status { font-weight: bold; margin-bottom: 0.4rem; }
.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 2rem);
    grid-auto-rows: 2rem;
    margin: 0 auto;
    width: max-content;
    border-radius: 0.3rem;
    overflow: hidden;
}
.chess-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    user-select: none;
}
.chess-cell.light { background: rgba(240, 217, 181, 0.85); }
.chess-cell.dark { background: rgba(181, 136, 99, 0.85); }
.chess-cell.last { box-shadow: inset 0 0 0 3px rgba(255, 215, 0, 0.8); }
.chess-cell.check { background: rgba(214, 40, 40, 0.8); }
.chess-cell.piece-w { color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000, 0 0 1px #000; }
.chess-cell.piece-b { color: #1a1a1a; }
.chess-votes { margin: 0.3rem 0 0; padding-left: 1.2rem; min-height: 3.6em; text-align: left; }
.chess-score { text-align: center; opacity: 0.8; }

#cookie-eater {
    position: fixed;
    left: 50%;
    bottom: 0.5rem;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 260px;
    padding: 0.3rem 0.8rem;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 0.8rem;
    text-align: center;
}
.eater-pile { font-size: 1rem; line-height: 1.1; min-height: 1.1em; overflow-wrap: anywhere; }
.eater-guy { font-size: 3rem; line-height: 1; animation: chew 0.7s ease-in-out infinite alternate; }
.eater-guy img { width: 90px; height: 90px; object-fit: cover; border-radius: 50%; display: block; }
#cookie-eater.has-photo .eater-guy span { display: none; }
.eater-caption { font-size: 0.75rem; font-weight: bold; color: #7b3f00; }
@keyframes chew {
    from { transform: scale(1, 1) translateY(0); }
    to   { transform: scale(1.06, 0.94) translateY(2px) rotate(2deg); }
}

#minesweeper {
    margin: 0 0 1rem;
    padding: 0.5rem 0.7rem;
    box-sizing: border-box;
    text-align: center;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 0.8rem;
}
.mines-status { font-weight: bold; margin-bottom: 0.4rem; }
.mines-grid {
    display: grid;
    grid-template-columns: repeat(10, 1.5rem);
    grid-auto-rows: 1.5rem;
    margin: 0 auto;
    width: max-content;
}
.mines-label, .mines-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    user-select: none;
}
.mines-label { opacity: 0.6; font-size: 0.7rem; }
.mines-cell {
    font-size: 0.85rem;
    font-weight: bold;
    background: rgba(200, 160, 120, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-sizing: border-box;
}
.mines-cell.open { background: rgba(245, 232, 210, 0.9); border-color: rgba(120, 80, 40, 0.2); }
.mines-cell.boom { background: rgba(214, 40, 40, 0.85); }
.mines-cell.n1 { color: #1d4ed8; } .mines-cell.n2 { color: #2e7d32; } .mines-cell.n3 { color: #d62828; }
.mines-cell.n4 { color: #4a148c; } .mines-cell.n5 { color: #8d3b00; } .mines-cell.n6 { color: #00838f; }
.mines-cell.n7 { color: #222; } .mines-cell.n8 { color: #777; }
.mines-votes { margin: 0.3rem 0 0; padding-left: 1.2rem; min-height: 3.6em; text-align: left; }
.mines-score { opacity: 0.8; }

.boss-cookie, .attack-cookie { cursor: var(--weapon-cursor, crosshair); }

#weapon-btn {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
    font-size: 28px;
    border-radius: 50%;
    border: 3px solid #000;
    background: #fff;
    cursor: pointer;
    z-index: 30;
}

#weapon-menu {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 80px;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border: 3px solid #000;
    border-radius: 8px;
    background: #fff;
    z-index: 30;
}
#weapon-menu.open { display: flex; }
#weapon-menu button { padding: 6px 10px; text-align: left; cursor: pointer; }
#weapon-menu button.selected { background: #ffd24a; font-weight: bold; }

/* Secret door + inside of the cookie jar */
#secret-door {
    position: fixed;
    left: 6px;
    bottom: 6px;
    width: 14px;
    height: 24px;
    background: #5a3318;
    border-radius: 7px 7px 0 0;
    opacity: 0.12;
    cursor: pointer;
    z-index: 50;
    transition: opacity 0.3s ease;
}
#secret-door:hover { opacity: 0.9; }
#secret-door .door-knob {
    position: absolute;
    right: 2px;
    top: 13px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: gold;
}
#jar-inside {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #f6d9a0 0%, #c98f4a 70%, #8a5a2a 100%);
}
#jar-inside.open { display: block; }
#jar-inside .jar-glass {
    position: absolute;
    inset: 3vh 3vw;
    border: 1.2vh solid rgba(255, 255, 255, 0.45);
    border-radius: 6vh;
    box-shadow: inset 0 0 8vh rgba(255, 255, 255, 0.4);
    pointer-events: none;
}
#jar-inside .jar-title {
    position: absolute;
    top: 6vh;
    width: 100%;
    font-size: 40px;
    color: #5a3318;
    text-shadow: 0 0 6px #fff, 0 0 12px #fff;
}
#jar-inside .jar-exit {
    position: absolute;
    bottom: 5vh;
    left: 50%;
    transform: translateX(-50%);
    font: inherit;
    font-size: 20px;
    padding: 1vh 2vw;
    cursor: pointer;
    z-index: 2;
}
.jar-room { position: absolute; inset: 0; display: none; }
.jar-room.active { display: block; }
.room-hall { background: radial-gradient(ellipse at center, #f6d9a0 0%, #c98f4a 70%, #8a5a2a 100%); }
.room-living { background: radial-gradient(ellipse at center, #f2b8a0 0%, #c9704a 75%, #7a3a2a 100%); }
.room-kitchen { background: repeating-conic-gradient(#fff8e0 0 25%, #e8d8a8 0 50%) 0 0 / 80px 80px; }
.room-bedroom { background: radial-gradient(ellipse at center, #c9b8f0 0%, #7a68b8 75%, #3a2f6a 100%); }
.room-library { background: radial-gradient(ellipse at center, #b88a5a 0%, #6a4220 75%, #3a2210 100%); }
.room-bathroom { background: repeating-conic-gradient(#d8f0f4 0 25%, #a8d4de 0 50%) 0 0 / 60px 60px; }
.room-decor { position: absolute; transform: translateX(-50%); line-height: 1; pointer-events: none; }
.room-door {
    position: absolute;
    width: 90px;
    height: 150px;
    font: inherit;
    cursor: pointer;
    z-index: 2;
    background: #7b4a22;
    color: #fff;
    border: 4px solid #4a2a10;
    border-radius: 45px 45px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.room-door:hover { background: #9a6030; }
.room-door-icon { font-size: 34px; }
.room-door-label { font-size: 14px; }
.room-door.door-left { left: 5vw; bottom: 14vh; }
.room-door.door-right { right: 5vw; bottom: 14vh; }
.room-door.door-top { left: 50%; top: 14vh; transform: translateX(-50%); }
.jar-cookie {
    position: absolute;
    width: 80px;
    height: 80px;
    transform: rotate(var(--tilt));
    animation: jar-bob var(--bob) ease-in-out var(--delay) infinite alternate;
}
.jar-cookie img {
    width: 100%;
    height: 100%;
    display: block;
}
.jar-cookie .jar-hat {
    position: absolute;
    left: 50%;
    top: -26px;
    transform: translateX(-50%);
    font-size: 40px;
    line-height: 1;
}
/* The very tired librarian: slumps slowly, snoring */
.jar-librarian {
    width: 110px;
    height: 110px;
    animation: librarian-droop 5s ease-in-out infinite;
    z-index: 1;
}
.jar-librarian-body { display: block; font-size: 100px; line-height: 1; }
.jar-librarian .jar-hat { top: -20px; left: 75%; font-size: 36px; }
.jar-zzz {
    position: absolute;
    right: -10px;
    top: -50px;
    font-size: 30px;
    animation: librarian-zzz 3s ease-in infinite;
}
@keyframes librarian-droop {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    40% { transform: rotate(14deg) translateY(10px); }
    55% { transform: rotate(14deg) translateY(10px); }
    60% { transform: rotate(2deg) translateY(0); }
}
@keyframes librarian-zzz {
    from { opacity: 0; transform: translateY(20px) scale(0.6); }
    30% { opacity: 1; }
    to { opacity: 0; transform: translateY(-30px) scale(1.2); }
}
@keyframes jar-bob {
    from { translate: 0 0; }
    to { translate: 0 -14px; }
}

/* Fullscreen alert when chat sends "message" */
#message-alert {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    color: #ff5a1f;
    font-size: 12vw;
    pointer-events: none;
    text-shadow: 0 0 3vw #ff9500;
}
#message-alert.show {
    display: flex;
    animation: message-pulse 0.4s ease-in-out infinite alternate;
}
@keyframes message-pulse {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

/* Battleship (shares the minesweeper panel look) */
#battleship {
    margin: 0 0 1rem;
    padding: 0.5rem 0.7rem;
    box-sizing: border-box;
    text-align: center;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 0.8rem;
}
.ship-status { font-weight: bold; margin-bottom: 0.4rem; }
.ship-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 2px;
    max-width: 18rem;
    margin: 0 auto;
}
.ship-label, .ship-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; }
.ship-label { opacity: 0.6; }
.ship-cell { background: rgba(60, 130, 200, 0.45); border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 3px; }
.ship-cell.miss { background: rgba(60, 130, 200, 0.2); }
.ship-cell.hit { background: rgba(214, 40, 40, 0.6); }
.ship-cell.reveal { background: rgba(120, 120, 130, 0.6); }
.ship-votes { margin: 0.3rem 0 0; padding-left: 1.2rem; min-height: 3.6em; text-align: left; }
.ship-score { opacity: 0.8; }

/* On-site chat input */
#chat-form { flex: none; display: flex; gap: 0.3rem; margin: 0.3rem 0.5rem; }
#chat-input { flex: 1; min-width: 0; font: inherit; padding: 0.4rem 0.6rem; border-radius: 0.5rem; border: 1px solid rgba(120, 80, 40, 0.4); }
#chat-form button { font: inherit; cursor: pointer; }

/* Fullscreen magic 8 ball */
#eight-ball {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 5, 40, 0.92);
    color: #e9d8ff;
    text-align: center;
    text-shadow: 0 0 3vw #9b5cff;
}
#eight-ball.show { display: flex; animation: message-pulse 0.8s ease-in-out infinite alternate; }
.eight-ball-icon { font-size: 22vw; line-height: 1; }
.eight-ball-answer { font-size: 6vw; padding: 0 5vw; }

/* 3D cookie */
#game { perspective: 1000px; }
button#cookie {
    --rx: 0deg; --ry: 0deg; --mx: 35%; --my: 30%;
    transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
    transform-style: preserve-3d;
    background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 235, 0.55), rgba(255, 255, 215, 0.2) 55%, rgba(90, 40, 0, 0.25));
    box-shadow: 0 3vh 4vh rgba(60, 25, 0, 0.35), inset 0 -1.5vh 3vh rgba(90, 40, 0, 0.25), inset 0 1vh 2vh rgba(255, 255, 255, 0.4);
}
button#cookie img { transform: translateZ(4vh); }
button#cookie::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    transform: translateZ(6vh);
    background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.35), transparent 40%);
}

/* Talking jar cookies */
.jar-cookie { cursor: pointer; }
.jar-bubble {
    position: absolute;
    z-index: 3;
    width: 240px;
    transform: translateX(-50%);
    padding: 0.5rem 0.7rem;
    box-sizing: border-box;
    text-align: left;
    color: #5a2d00;
    background: #fffbe8;
    border: 3px solid #7b3f00;
    border-radius: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.jar-bubble.visible { opacity: 1; }
.jar-bubble strong { display: block; }
.jar-talk {
    position: absolute;
    bottom: 12vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.3rem;
    z-index: 2;
}
.jar-talk input { width: 28vw; min-width: 200px; font: inherit; padding: 0.4rem 0.6rem; border-radius: 0.5rem; border: 1px solid #7b3f00; }
.jar-talk button { font: inherit; cursor: pointer; }

.confetti {
    position: fixed;
    width: 10px;
    height: 16px;
    z-index: 2500;
    pointer-events: none;
    border-radius: 2px;
}

/* Cookie clicker inside the cookie clicker */
#inception {
    margin: 0 0 1rem;
    padding: 0.5rem 0.7rem;
    box-sizing: border-box;
    text-align: center;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 0.8rem;
}
.inception-level { margin-top: 0.4rem; padding: 0.4rem; border: 1px dashed rgba(255, 255, 255, 0.6); border-radius: 0.6rem; background: rgba(0, 0, 0, 0.06); }
.inception-title { font-weight: bold; }
.inception-cookie { font-size: 2rem; background: none; border: none; cursor: pointer; }
.inception-cookie:active { transform: scale(0.9); }
.inception-buttons { display: flex; gap: 0.3rem; justify-content: center; flex-wrap: wrap; }
.inception-buttons button[hidden] { display: none; }

/* Weather */
#weather-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.weather-particle { position: absolute; top: -2rem; font-size: 1rem; animation: weather-fall linear infinite; }
@keyframes weather-fall { to { transform: translateY(110vh) translateX(3vw); } }
#weather-layer.sunny { background: radial-gradient(circle at 90% 0%, rgba(255, 220, 80, 0.55), transparent 55%); }
#weather-layer.storm { animation: lightning 7s infinite; }
@keyframes lightning {
    0%, 92%, 96%, 100% { background: transparent; }
    93%, 97% { background: rgba(255, 255, 255, 0.55); }
}
.weather-particle.catchable { pointer-events: auto; cursor: pointer; font-size: 2.2rem; }

/* Evil cookie: small, right next to the real one */
#cookie-wrap { position: relative; display: inline-block; }
button#evil-cookie {
    position: absolute;
    right: -6vh;
    bottom: 2vh;
    width: 7vh;
    height: 7vh;
    padding: 0.5vh;
    border: 0;
    border-radius: 50%;
    background: rgba(60, 0, 0, 0.35);
    cursor: pointer;
    outline: none;
}
button#evil-cookie img {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    filter: grayscale(1) brightness(0.35) sepia(1) hue-rotate(-50deg) saturate(6) drop-shadow(0 0 0.8vh red);
}
button#evil-cookie:hover { transform: scale(1.1) rotate(-8deg); }

/* Sunglasses on the main cookie */
button#cookie .sunglasses {
    position: absolute;
    left: 24%;
    top: 36%;
    width: 52%;
    pointer-events: none;
    filter: drop-shadow(0 0.5vh 0.5vh rgba(0, 0, 0, 0.4));
    /* the cookie is a 3D scene (image at translateZ 4vh), so the glasses must sit in front of it */
    transform: translateZ(8vh);
}

/* Day and night */
#night-overlay {
    position: fixed; inset: 0; pointer-events: none; z-index: 4;
    background: rgba(8, 16, 60, var(--dark, 0));
    mix-blend-mode: multiply;
    transition: background 5s linear;
}
.night-star {
    position: absolute; width: 3px; height: 3px; border-radius: 50%;
    background: #fff; box-shadow: 0 0 6px #fff;
    opacity: var(--stars, 0);
    animation: star-twinkle 3s ease-in-out infinite alternate;
}
@keyframes star-twinkle { to { transform: scale(1.8); } }

/* Font picker */
#font-picker { position: fixed; right: 0.6rem; bottom: 0.6rem; z-index: 30; font-family: sans-serif; font-size: 0.8rem; text-align: left; }
.font-toggle { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.6); cursor: pointer; font-weight: bold; }
.font-panel { position: absolute; right: 0; bottom: 3rem; width: 14rem; padding: 0.6rem; display: flex; flex-direction: column; gap: 0.4rem; background: rgba(255, 255, 255, 0.92); border-radius: 0.6rem; box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); }
.font-panel[hidden] { display: none; }
.font-upload { cursor: pointer; text-decoration: underline; }

.golden-cookie.pubnub-cookie {
    background: radial-gradient(circle at 35% 30%, #ff7a7a, #ef3a43 55%, #a3121a);
    filter: drop-shadow(0 0 16px #ef3a43);
    width: 110px;
    height: 110px;
    font-size: 40px;
    line-height: 110px;
    text-align: center;
    border: 3px solid #fff;
    border-radius: 50%;
}
.golden-cookie.pubnub-cookie::after {
    content: "PubNub";
    position: absolute;
    left: 0; right: 0; bottom: 10px;
    font-size: 14px;
    line-height: 1;
    font-weight: bold;
    color: #fff;
}
