/* PicnicDayz — blocky/voxel arcade theme */

:root {
    --bg: #fdeaf0;          /* light subtle pink */
    --bg-deep: #f6c6d5;
    --panel: #fffdf5;
    --ink: #3d2333;        /* deep plum — pairs with the pink bg */
    --brand: #f5c93c;       /* gold */
    --brand-dark: #b58a12;
    --accent: #3a63c4;      /* lapis */
    --danger: #d84f3f;
    --shadow: #3d2333;
    --radius: 4px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Nunito', system-ui, sans-serif;
    color: var(--ink);
    background:
        linear-gradient(rgba(255, 255, 255, 0.04) 50%, transparent 50%) 0 0 / 32px 32px,
        linear-gradient(90deg, rgba(0, 0, 0, 0.04) 50%, transparent 50%) 0 0 / 32px 32px,
        var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, .logo, .btn, .tile-badge, .bucks-chip {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-weight: 600;
}

/* ---------- header ---------- */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 20px;
    background: var(--ink);
    border-bottom: 6px solid var(--brand);
}

.logo {
    color: #fff;
    font-size: 26px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-block {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--brand);
    color: var(--ink);
    border: 3px solid #fff;
    box-shadow: 3px 3px 0 var(--brand-dark);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    font-weight: 900;
}

.nav-link:hover { color: var(--brand); }

.nav-cta {
    background: var(--brand);
    color: var(--ink);
    padding: 8px 12px;
    border: 3px solid #fff;
    box-shadow: 3px 3px 0 var(--brand-dark);
}

.nav-cta:hover { color: var(--ink); transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--brand-dark); }

.nav-user { color: #f0d0e0; font-weight: 900; }

.bucks-chip {
    background: #56304a;
    color: var(--brand);
    font-size: 15px;
    padding: 6px 12px;
    border: 2px solid var(--brand);
}

/* ---------- layout ---------- */

.site-main {
    flex: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.site-footer {
    text-align: center;
    padding: 18px;
    background: var(--ink);
    color: #f0d0e0;
    font-weight: 700;
}

/* ---------- hero ---------- */

.hero {
    text-align: center;
    padding: 30px 10px 10px;
}

.hero h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.25; }
.hero-accent { color: #e05a80; text-shadow: 3px 3px 0 var(--shadow); }
.hero p { font-size: 18px; font-weight: 700; }

/* ---------- buttons ---------- */

.btn {
    display: inline-block;
    background: var(--brand);
    color: var(--ink);
    border: 3px solid var(--ink);
    box-shadow: 4px 4px 0 var(--shadow);
    padding: 12px 20px;
    font-size: 17px;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-big { font-size: 19px; }

/* ---------- game tiles ---------- */

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
    margin-top: 28px;
}

.tile {
    background: var(--panel);
    border: 4px solid var(--ink);
    box-shadow: 6px 6px 0 var(--shadow);
    padding: 18px;
    text-decoration: none;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.tile h2 { font-size: 21px; margin: 6px 0 0; line-height: 1.25; }
.tile p { margin: 0; font-weight: 700; }

.tile-art {
    font-size: 54px;
    line-height: 1;
    background: var(--bg-deep);
    border: 3px solid var(--ink);
    padding: 18px 0;
    text-align: center;
}

.tile-live:hover { transform: translate(2px, 2px); box-shadow: 4px 4px 0 var(--shadow); }

.tile-soon { opacity: 0.82; }
.tile-soon .tile-art { filter: grayscale(0.35); }

.tile-best { color: var(--accent); }

.tile-badge {
    align-self: flex-start;
    font-size: 14px;
    padding: 7px 10px;
    border: 2px solid var(--ink);
    margin-top: auto;
}

.badge-play { background: var(--brand); }
.badge-soon { background: #d8d3c2; }

.tile-market { border-color: var(--accent); }

/* ---------- auth forms ---------- */

.auth-card {
    max-width: 460px;
    margin: 30px auto;
    background: var(--panel);
    border: 4px solid var(--ink);
    box-shadow: 6px 6px 0 var(--shadow);
    padding: 26px;
}

.auth-card h1 { font-size: 27px; line-height: 1.25; }
.auth-sub { font-weight: 700; }

.auth-card label {
    display: block;
    font-weight: 900;
    margin: 16px 0 6px;
}

.auth-card input {
    width: 100%;
    padding: 12px;
    font: inherit;
    font-weight: 700;
    border: 3px solid var(--ink);
    background: #fff;
}

.auth-card input:focus { outline: 3px solid var(--brand); }
.auth-card .btn { margin-top: 22px; width: 100%; text-align: center; }
.auth-alt { margin-top: 18px; font-weight: 700; }

.alert {
    background: #fdeae7;
    border: 3px solid var(--danger);
    padding: 4px 14px;
    font-weight: 700;
    margin: 14px 0;
}

/* ---------- game page ---------- */

.game-wrap {
    display: flex;
    gap: 24px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-top: 10px;
}

.game-title { font-size: 25px; line-height: 1.25; margin: 0 0 14px; }

.game-side {
    background: var(--panel);
    border: 4px solid var(--ink);
    box-shadow: 6px 6px 0 var(--shadow);
    padding: 18px;
    width: 200px;
}

.stat-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px dashed #c9c2ac;
    padding: 8px 0;
    font-weight: 900;
}

.stat-box strong { font-family: 'Fredoka', 'Nunito', sans-serif; font-size: 19px; }

.next-box { flex-direction: column; align-items: flex-start; gap: 8px; }
.next-box canvas { border: 3px solid var(--ink); background: #101418; align-self: center; }

.controls-hint { font-size: 13px; font-weight: 700; color: #8a6a7c; line-height: 1.7; }

.game-stage { position: relative; }

#game-canvas {
    border: 4px solid var(--ink);
    box-shadow: 6px 6px 0 var(--shadow);
    background: #101418;
    display: block;
    max-width: 100%;
    height: auto;
}

.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(16, 20, 24, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.game-overlay.hidden { display: none; }

.overlay-card {
    background: var(--panel);
    border: 4px solid var(--ink);
    box-shadow: 6px 6px 0 #000;
    padding: 22px;
    text-align: center;
    max-width: 260px;
}

.overlay-card h2 { font-size: 21px; line-height: 1.25; }
.overlay-card p { font-weight: 700; }

/* ---------- locker & marketplace ---------- */

.locker-wrap { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; margin-top: 10px; }

.locker-preview {
    background: var(--panel); border: 4px solid var(--ink);
    box-shadow: 6px 6px 0 var(--shadow); padding: 20px; width: 300px;
    text-align: center; flex-shrink: 0;
}
.locker-preview h1 { font-size: 25px; margin: 0 0 4px; }
.player-name { color: #e05a80; font-weight: 900; }
.stage {
    background: var(--bg-deep); border: 3px solid var(--ink);
    display: flex; align-items: flex-end; justify-content: center;
    gap: 6px; padding: 12px 6px 8px; margin: 12px 0;
}
.stage canvas { image-rendering: pixelated; }
.pet-name-row { font-weight: 900; margin: 2px 0 10px; }
.pet-name-row input {
    font: inherit; font-weight: 700; width: 110px; padding: 4px 8px;
    border: 3px solid var(--ink); text-align: center;
}
.saved-pulse {
    display: inline-block; margin-left: 8px; color: #2e7d32; font-weight: 900;
    opacity: 0; transition: opacity 0.25s;
}
.saved-pulse.show { opacity: 1; }

.locker-items {
    background: var(--panel); border: 4px solid var(--ink);
    box-shadow: 6px 6px 0 var(--shadow); padding: 18px;
    flex: 1; min-width: 320px;
}
.tab-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab-btn {
    font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 15px;
    background: var(--bg); border: 3px solid var(--ink); padding: 8px 14px; cursor: pointer;
}
.tab-btn.active { background: var(--brand); box-shadow: 3px 3px 0 var(--shadow); }

.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.item-card {
    position: relative; background: #fff; border: 3px solid #b9b0a6;
    padding: 8px; text-align: center; cursor: pointer; user-select: none;
}
.item-card:hover { transform: translate(1px, 1px); }
.item-card canvas { display: block; margin: 0 auto; image-rendering: pixelated; }
.item-card .item-name { font-weight: 900; font-size: 13px; line-height: 1.2; margin-top: 6px; }
.item-card .item-rarity { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; }
.item-card .item-price { font-weight: 900; color: var(--brand-dark); margin-top: 2px; }

.item-card.r-common    { border-color: #b9b0a6; }  .r-common .item-rarity    { color: #8a8378; }
.item-card.r-rare      { border-color: var(--accent); } .r-rare .item-rarity   { color: var(--accent); }
.item-card.r-epic      { border-color: #a45ae0; }  .r-epic .item-rarity      { color: #a45ae0; }
.item-card.r-legendary { border-color: var(--brand); box-shadow: 0 0 10px rgba(245, 201, 60, 0.7); }
.r-legendary .item-rarity { color: var(--brand-dark); }

.equip-badge {
    position: absolute; top: -10px; right: -10px; width: 26px; height: 26px;
    background: #2e7d32; color: #fff; border: 3px solid #fff; border-radius: 50%;
    display: none; align-items: center; justify-content: center; font-weight: 900;
}
.item-card.equipped .equip-badge { display: flex; }
.item-card.equipped { outline: 3px solid #2e7d32; }
.item-card.owned-tag::after {
    content: 'OWNED'; position: absolute; top: 6px; left: 6px;
    background: #2e7d32; color: #fff; font-size: 10px; font-weight: 900; padding: 2px 5px;
}
.limited-tag {
    position: absolute; top: 6px; right: 6px;
    background: var(--danger); color: #fff; font-size: 10px; font-weight: 900; padding: 2px 5px;
}

.swatch-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 18px; }
.swatch { width: 44px; height: 44px; border: 3px solid var(--ink); cursor: pointer; }
.swatch.selected { outline: 4px solid var(--brand); }
.swatch-label { font-weight: 900; margin: 10px 0 2px; }

.empty-cat {
    border: 3px dashed #b9b0a6; padding: 22px; text-align: center; font-weight: 900;
    grid-column: 1 / -1;
}
.empty-cat a { color: var(--accent); }

.modal-overlay {
    position: fixed; inset: 0; background: rgba(43, 23, 36, 0.8); z-index: 200;
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal-card {
    background: var(--panel); border: 4px solid var(--ink); box-shadow: 6px 6px 0 #000;
    padding: 24px; text-align: center; max-width: 420px; width: 100%;
}
.modal-card h2 { font-size: 21px; line-height: 1.25; margin-top: 0; }
.modal-card .btn { margin: 6px; }
.btn-quiet { background: #d8d3c2; }
.hatch-pets { display: flex; gap: 12px; justify-content: center; margin: 14px 0; }
.hatch-pets .item-card { width: 110px; }
.modal-card input {
    font: inherit; font-weight: 700; padding: 8px 10px; border: 3px solid var(--ink);
    text-align: center; width: 200px; margin-top: 8px;
}
.header-avatar {
    display: block;   /* inline canvas adds baseline gap that inflates the header */
    image-rendering: pixelated;
    border: 2px solid var(--brand);
    background: var(--bg-deep);
}

/* ---------- header account menu ---------- */

.account-menu { position: relative; }

.account-toggle {
    display: flex; align-items: center; gap: 8px;
    background: #56304a; color: #fff;
    border: 2px solid var(--brand); padding: 3px 10px;
    height: 40px; box-sizing: border-box;
    font: inherit; font-weight: 900; cursor: pointer;
}

.bucks-chip { height: 40px; box-sizing: border-box; display: inline-flex; align-items: center; }

.account-toggle:hover { background: #6b3d5c; }
.account-caret { color: var(--brand); font-size: 12px; }

.account-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px);
    background: var(--panel); border: 3px solid var(--ink);
    box-shadow: 4px 4px 0 var(--shadow); min-width: 190px; z-index: 150;
}

.account-dropdown.hidden { display: none; }

.account-dropdown a {
    display: block; padding: 12px 16px; color: var(--ink);
    text-decoration: none; font-weight: 900;
    border-bottom: 2px dashed #d8d3c2;
}

.account-dropdown a:last-child { border-bottom: none; }
.account-dropdown a:hover { background: var(--bg); }

/* ---------- obby rush ---------- */

.obby-wrap { margin-top: 6px; }

.obby-stage {
    position: relative;
    border: 4px solid var(--ink);
    box-shadow: 6px 6px 0 var(--shadow);
    background: #aee7f5;
    overflow: hidden;
}

.obby-stage canvas { display: block; width: 100%; }

.obby-hud {
    position: absolute; top: 10px; left: 12px;
    background: rgba(255, 253, 245, 0.9);
    border: 3px solid var(--ink);
    padding: 8px 12px;
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-weight: 600; font-size: 17px;
}

.sens-row { margin: 10px 0 14px; font-weight: 900; }
.sens-label { margin-right: 6px; }
.sens-btn {
    font: inherit; font-weight: 700; font-size: 13px;
    background: var(--bg); border: 2px solid var(--ink);
    padding: 6px 9px; cursor: pointer; margin: 2px;
}
.sens-btn.active { background: var(--brand); box-shadow: 2px 2px 0 var(--shadow); }

.obby-pause {
    position: absolute; top: 10px; right: 12px;
    width: 46px; height: 46px;
    background: var(--brand); border: 3px solid var(--ink);
    box-shadow: 3px 3px 0 var(--shadow);
    font-size: 18px; cursor: pointer;
}

/* ---------- touch controls ---------- */

.touch-controls {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(61, 35, 51, 0.95);
    padding: 10px;
    justify-content: center;
    gap: 10px;
    z-index: 50;
}

.touch-btn {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-size: 20px;
    background: var(--panel);
    border: 3px solid var(--ink);
    box-shadow: 3px 3px 0 #000;
    padding: 14px 18px;
    cursor: pointer;
}

.touch-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
.touch-drop { background: var(--brand); font-size: 15px; }

@media (pointer: coarse) {
    .touch-controls { display: flex; }
    .site-main { padding-bottom: 120px; }
}

@media (max-width: 640px) {
    .tile-grid { grid-template-columns: 1fr; }
    .game-side { width: 100%; max-width: 300px; }
}
