:root {
    --bg: #0d0505;
    --wrap: #140808;
    --box: #1a0a0a;
    --box2: #220c0c;
    --border: #5c1414;
    --hi: #a33a3a;
    --accent: #8b1a1a;
    --accent-light: #c92a2a;
    --heading: #ff6b6b;
    --title-text: #ffe0e0;
    --text: #e8d0d0;
    --soft: #c9a8a8;
    --link: #ff8080;
    --visited: #d48ac4;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 20px 10px 40px;
    background-color: var(--bg);
    background-image:
        linear-gradient(45deg, rgba(139,26,26,.10) 25%, transparent 25%, transparent 75%, rgba(139,26,26,.10) 75%),
        linear-gradient(45deg, rgba(139,26,26,.10) 25%, transparent 25%, transparent 75%, rgba(139,26,26,.10) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
    color: var(--text);
    font: 12px/1.55 Verdana, Tahoma, Arial, sans-serif;
}

a { color: var(--link); }
a:visited { color: var(--visited); }
a:hover { color: #fff; background: var(--accent); text-decoration: none; }
img { max-width: 100%; }
p { margin: 8px 0; }
b { color: #fff; }
hr { border: 0; border-top: 1px dotted var(--border); margin: 12px 0; }
::selection { background: var(--accent-light); color: #fff; }

#wrap {
    max-width: 880px;
    margin: 0 auto;
    background: var(--wrap);
    border: 3px ridge var(--accent);
    box-shadow: 0 0 0 1px #000, 0 0 40px rgba(201,42,42,.18);
}

#header {
    text-align: center;
    padding: 22px 12px 16px;
    background:
        radial-gradient(ellipse at center, rgba(201,42,42,.28), transparent 70%),
        linear-gradient(#2a0909, #0d0505);
    border-bottom: 2px solid var(--border);
}

#header h1 {
    margin: 0;
    font: bold 36px Georgia, "Times New Roman", serif;
    color: var(--heading);
    letter-spacing: 1px;
    text-shadow: 2px 2px 0 #000, 0 0 12px rgba(255,107,107,.55);
}

.subhead { margin-top: 4px; color: var(--soft); font-size: 11px; font-style: italic; }

.sparkle { color: var(--accent-light); font-size: 16px; letter-spacing: 10px; margin-top: 8px; }

#nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 6px;
    background: linear-gradient(#1f0909, #120505);
    border-bottom: 1px solid #000;
}

.btn, #nav a, button.btn {
    display: inline-block;
    padding: 4px 11px;
    font: bold 11px Verdana, Tahoma, sans-serif;
    color: var(--text);
    text-decoration: none;
    background: linear-gradient(#3a1111, #1c0606);
    border: 2px solid;
    border-color: var(--hi) #000 #000 var(--hi);
    cursor: pointer;
}

.btn:visited, #nav a:visited { color: var(--text); }
.btn:hover, #nav a:hover { color: #fff; background: linear-gradient(#c92a2a, #7a1414); }
.btn:active, #nav a:active { border-color: #000 var(--hi) var(--hi) #000; }
#nav a.here { color: #fff; background: linear-gradient(#c92a2a, #7a1414); border-color: #000 var(--hi) var(--hi) #000; }
.btn:disabled { opacity: .45; cursor: not-allowed; background: linear-gradient(#3a1111, #1c0606); color: var(--text); }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }

#content { padding: 16px; }

#wrap.wide { max-width: 1200px; }

.cols { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
.cols3 { grid-template-columns: 220px minmax(0, 1fr) 240px; }
.cols3 > .side { position: sticky; top: 12px; }
.side, .main { display: grid; gap: 18px; align-content: start; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

.box {
    position: relative;
    background: var(--box);
    border: 1px solid var(--border);
    box-shadow: 3px 3px 0 #000;
}

.box::before, .box::after {
    content: "";
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffb0b0, var(--accent-light) 55%, #4a0808);
    box-shadow: 0 0 5px var(--accent-light);
    z-index: 2;
}

.box::before { top: -4px; left: -4px; }
.box::after { bottom: -4px; right: -4px; }

.box-title {
    padding: 3px 8px;
    font: bold 11px Verdana, Tahoma, sans-serif;
    color: var(--title-text);
    letter-spacing: .5px;
    text-shadow: 1px 1px 0 #000;
    background: linear-gradient(#a82323, #5c1414);
    border-bottom: 1px solid #000;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}

.box-body { padding: 10px 12px; }
.box-body::after { content: ""; display: block; clear: both; }
.box-body > :first-child { margin-top: 0; }
.box-body > :last-child { margin-bottom: 0; }

.tape {
    position: absolute;
    top: -9px;
    right: 30px;
    width: 58px;
    height: 18px;
    background: rgba(255,200,200,.16);
    border: 1px solid rgba(255,255,255,.12);
    transform: rotate(5deg);
    z-index: 3;
    pointer-events: none;
}

.tape.l { right: auto; left: 46px; transform: rotate(-6deg); }

.box ul { list-style: none; padding: 0; margin: 6px 0; }
.box li { position: relative; padding-left: 15px; margin: 4px 0; }
.box li::before { content: "»"; position: absolute; left: 2px; color: var(--accent-light); font-weight: bold; }

.sub { font-weight: bold; color: var(--heading); border-bottom: 1px dotted var(--border); margin: 0 0 4px; font-size: 12px; }

.blink { color: var(--accent-light); font-weight: bold; }

.tiny { font-size: 10px; color: var(--soft); }
.center { text-align: center; }

.photo {
    background: #fff;
    padding: 3px;
    border: 1px solid #000;
    box-shadow: 2px 2px 0 #000;
    cursor: pointer;
}

.photo:hover { outline: 2px solid var(--heading); }

.pfp { float: left; width: 96px; height: 96px; object-fit: cover; margin: 0 12px 6px 0; transform: rotate(-3deg); background-color: #6b1a1a; }

.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.person { overflow: hidden; padding: 8px 0; border-top: 1px dotted var(--border); }
.person:first-of-type { border-top: 0; }
.person img { float: left; width: 80px; height: 80px; object-fit: cover; margin: 2px 12px 4px 0; }
.person:nth-of-type(odd) img { transform: rotate(-3deg); }
.person:nth-of-type(even) img { transform: rotate(3deg); }
.person .name { font-weight: bold; color: var(--heading); font-size: 13px; }
.person p { margin: 2px 0 0; }

.profile { display: flex; gap: 16px; align-items: flex-start; }
.profile > img { width: 150px; height: 150px; object-fit: cover; flex: none; transform: rotate(-3deg); margin-top: 4px; }
.profile table { border-collapse: collapse; width: 100%; }
.profile th, .profile td { text-align: left; vertical-align: top; padding: 5px 8px; border-bottom: 1px dotted var(--border); }
.profile th { width: 130px; color: var(--heading); white-space: nowrap; }
.profile tr:last-child th, .profile tr:last-child td { border-bottom: 0; }
.profile td ul { margin: 0; }

.shrine img { width: 150px; height: 150px; object-fit: cover; transform: rotate(-2deg); margin: 4px 0; }

.playlist img { width: 140px; height: 140px; object-fit: cover; }

.artists { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.artist { width: 140px; padding: 6px; text-align: center; background: var(--box2); border: 1px solid var(--border); }
.artist img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid #000; }
.artist a:hover { background: none; }
.artist .name { margin-top: 5px; font-weight: bold; color: var(--heading); }
.artist .what { font-size: 10px; color: var(--soft); }

.setup { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 8px 0; }
.setup img { width: 170px; height: 128px; object-fit: cover; }

.dump { text-align: center; }
.dump img { width: 118px; height: 118px; object-fit: cover; margin: 6px; vertical-align: top; }
.dump img:nth-child(4n+1) { transform: rotate(-5deg); }
.dump img:nth-child(4n+2) { transform: rotate(4deg); margin-top: 14px; }
.dump img:nth-child(4n+3) { transform: rotate(-2deg); }
.dump img:nth-child(4n) { transform: rotate(6deg); margin-top: 10px; }

.warn {
    text-align: center;
    font-weight: bold;
    color: #ffb0b0;
    background: #2b0d0d;
    border: 2px dashed #ff4c4c;
    padding: 6px;
    margin-bottom: 8px;
}

.inner { background: var(--bg); border: 1px solid var(--border); padding: 8px 10px; }

.video { position: relative; aspect-ratio: 16/9; border: 2px inset var(--border); background: #000; margin-top: 6px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.counter-img { display: inline-block; max-width: 100%; height: auto; padding: 4px; background: #000; border: 3px inset #666; image-rendering: pixelated; }

.presence { text-align: center; }
.presence img { display: block; max-width: 100%; height: auto; margin: 6px auto; border: 2px inset var(--border); background: #000; }
.presence .tiny { margin-top: 6px; }
.stickers { text-align: center; }
.sticker {
    display: inline-block;
    margin: 3px;
    padding: 4px 8px;
    font-size: 10px;
    color: var(--soft);
    background: var(--box);
    border: 2px dashed var(--accent);
    transform: rotate(-3deg);
}
.sticker:nth-child(even) { transform: rotate(2deg); }

.entry { background: var(--bg); border: 1px solid var(--border); padding: 10px 12px; margin-bottom: 12px; }
.entry:last-child { margin-bottom: 0; }
.entry-date { font: 11px "Courier New", monospace; color: var(--accent-light); }
.entry-title { font-weight: bold; font-size: 14px; color: var(--heading); margin: 2px 0 6px; }
.entry img { display: block; max-width: min(100%, 420px); margin: 10px 0 4px; }

.game-area { text-align: center; background: #000; border: 2px inset var(--border); padding: 10px; }
.game-area.active { border-color: var(--heading); box-shadow: 0 0 10px rgba(255,107,107,.4); }
.score { font: bold 12px "Courier New", monospace; color: var(--accent-light); margin: 4px 0 8px; }
.score span { color: #fff; }
canvas { display: block; margin: 0 auto; width: 100%; max-width: 300px; height: auto; border: 1px solid var(--border); image-rendering: pixelated; }
.dpad { margin: 8px 0; }
.dpad .btn { width: 36px; padding: 4px 0; margin: 1px; }

#grid-2048 { display: inline-grid; grid-template-columns: repeat(4, 58px); gap: 5px; padding: 6px; background: var(--box); border: 1px solid var(--border); }
.tile { height: 58px; display: flex; align-items: center; justify-content: center; font: bold 16px Verdana, sans-serif; background: var(--box2); border: 1px solid var(--border); color: var(--text); }
.tile[data-val="2"] { background: #2a0f0f; }
.tile[data-val="4"] { background: #3f1414; }
.tile[data-val="8"] { background: #541a1a; color: #fff; }
.tile[data-val="16"] { background: #6b1a1a; color: #fff; }
.tile[data-val="32"] { background: #8b1a1a; color: #fff; }
.tile[data-val="64"] { background: #a82323; color: #fff; }
.tile[data-val="128"] { background: #c92a2a; color: #fff; font-size: 14px; }
.tile[data-val="256"] { background: #ff4444; color: #fff; font-size: 14px; }
.tile[data-val="512"] { background: #ff6b6b; color: #fff; font-size: 14px; }
.tile[data-val="1024"] { background: #ff9e9e; color: #0d0505; font-size: 12px; }
.tile[data-val="2048"] { background: #ffd0d0; color: #0d0505; font-size: 12px; }

#clicker-zone { position: relative; }
#clicker-btn {
    display: block;
    width: 110px;
    height: 110px;
    margin: 8px auto;
    border-radius: 50%;
    font-size: 46px;
    color: #ffe0e0;
    background: radial-gradient(circle at 35% 30%, #ff6b6b, #5c1414);
    border: 3px outset var(--accent-light);
    cursor: pointer;
}
#clicker-btn:active { border-style: inset; }
.pop { position: absolute; font: bold 13px Verdana, sans-serif; color: #fff; pointer-events: none; animation: floatup .8s ease-out forwards; }
@keyframes floatup { to { transform: translateY(-40px); opacity: 0; } }

.upgrades { max-width: 400px; margin: 8px auto; text-align: left; }
.upg { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 8px; margin-bottom: 5px; background: var(--box); border: 1px solid var(--border); }

.frame { background: transparent; }
.frame iframe { display: block; width: 100%; height: 520px; border: 0; overflow: hidden; background: transparent; }

.ring { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 12px 0 6px; }
.ring a { font-weight: bold; text-decoration: none; }
.ring a:hover { background: none; }
.ring img { display: block; image-rendering: pixelated; }

#footer { padding: 10px; text-align: center; font-size: 10px; color: var(--soft); border-top: 1px solid var(--border); background: #0d0505; }

.lost { min-height: calc(100vh - 60px); display: grid; place-items: center; }
.lost .box { max-width: 420px; text-align: center; }
.lost .big { font: bold 64px Georgia, serif; color: var(--heading); text-shadow: 3px 3px 0 #000; margin: 4px 0; }

#lightbox { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.9); cursor: pointer; }
#lightbox.open { display: flex; }
#lightbox img { max-width: 90%; max-height: 82vh; border: 5px solid #fff; box-shadow: 0 0 20px #000; }
#lightbox button { position: absolute; top: 16px; right: 20px; font: bold 13px "Courier New", monospace; padding: 5px 12px; color: var(--text); background: var(--box); border: 2px outset var(--accent); cursor: pointer; }

@media (max-width: 1060px) {
    .cols3 { grid-template-columns: 220px minmax(0, 1fr); }
    .cols3 > .side { position: static; }
    .side-r { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}

@media (max-width: 720px) {
    #header h1 { font-size: 28px; }
    .cols, .grid-2, .cols-2 { grid-template-columns: 1fr; }
    #content { padding: 12px 10px; }
    .pfp { float: none; display: block; margin: 0 auto 10px; }
    .profile { flex-direction: column; align-items: center; }
    .profile th { width: auto; white-space: normal; }
    #grid-2048 { grid-template-columns: repeat(4, 52px); }
    .tile { height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
    .pop { animation: none; }
}
