/* =====================================================================
   Extras stylesheet for The Machinist
   - theme variables / theme switcher
   - cmd-K command palette
   - now-playing & discord widgets
   - reaction buttons
   - music mini-player
   - new easter eggs (snow / NK / vatican)
   - cursed BSOD overlay
   ===================================================================== */

:root {
    --accent: #8B0000;
    --accent-soft: rgba(139, 0, 0, 0.25);
    --accent-glow: rgba(139, 0, 0, 0.5);
    --bg: #101010;
    --text: #ffffff;
    --muted: #e5e7eb;
}

body[data-theme="black"] {
    --accent: #444;
    --accent-soft: rgba(120, 120, 120, 0.25);
    --accent-glow: rgba(120, 120, 120, 0.5);
    --bg: #000;
}

body[data-theme="midnight"] {
    --accent: #4f46e5;
    --accent-soft: rgba(79, 70, 229, 0.25);
    --accent-glow: rgba(79, 70, 229, 0.5);
    --bg: #06061a;
}

body[data-theme="femboy"] {
    --accent: #ff7ac6;
    --accent-soft: rgba(255, 122, 198, 0.3);
    --accent-glow: rgba(255, 122, 198, 0.6);
    --bg: #1a0a14;
}

body[data-theme="acid"] {
    --accent: #00ff88;
    --accent-soft: rgba(0, 255, 136, 0.25);
    --accent-glow: rgba(0, 255, 136, 0.5);
    --bg: #0a0f0a;
}

/* Theme overrides for existing controls */
body[data-theme] .btns,
body[data-theme] .question-button,
body[data-theme] .israel-question-button {
    border-color: var(--accent);
}

body[data-theme] .btns:hover,
body[data-theme] .question-button:hover,
body[data-theme] .israel-question-button:hover {
    background-color: var(--accent-soft);
    box-shadow: 0 10px 28px var(--accent-glow);
}

body[data-theme] .avatar {
    border-color: var(--accent);
}

/* =====================================================================
   Theme switcher
   ===================================================================== */
.theme-switcher {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 800;
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px;
    border-radius: 999px;
}

.theme-switcher button {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: var(--swatch);
    cursor: pointer;
    padding: 0;
    transition: transform .12s ease, box-shadow .15s ease;
}

.theme-switcher button:hover {
    transform: scale(1.15);
}

.theme-switcher button.active {
    box-shadow: 0 0 0 2px #fff, 0 0 12px var(--swatch);
}

/* =====================================================================
   Command palette (Ctrl+K)
   ===================================================================== */
.cmdk {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1500;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}

.cmdk.show { display: flex; }

.cmdk-box {
    background: #0d0d0d;
    border: 1px solid var(--accent);
    border-radius: 14px;
    width: 92%;
    max-width: 560px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    font-family: 'Ubuntu', sans-serif;
}

.cmdk-input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: #fff;
    font-size: 1.05rem;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
}

.cmdk-list {
    max-height: 50vh;
    overflow-y: auto;
}

.cmdk-item {
    padding: 10px 16px;
    color: #ddd;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.cmdk-item:hover,
.cmdk-item.active {
    background: var(--accent-soft);
    color: #fff;
}

.cmdk-item .hint {
    color: #888;
    font-size: 0.8rem;
}

/* =====================================================================
   Discord status pill + Now playing
   ===================================================================== */
.status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    align-items: stretch;
    margin: 1.2rem auto 0;
    max-width: 900px;
}

/* Hidden last.fm slot collapses entirely so the discord card stays centered alone */
.lastfm-card.hidden {
    display: none;
}

/* ---------- guns.lol-style discord card ---------- */
.discord-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px 14px 16px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    color: #fff;
    text-decoration: none;
    flex: 1 1 320px;
    min-width: 280px;
    max-width: 460px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease;
    position: relative;
}

.discord-card:hover {
    border-color: var(--accent);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--accent-soft);
}

.discord-card.dc-streaming {
    border-color: #593695;
    box-shadow: 0 0 0 1px #593695, 0 14px 40px rgba(89, 54, 149, 0.35);
}

.discord-card .dc-avatar,
.discord-card .dc-avatar-wrap {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.discord-card .dc-avatar.dimmed { filter: brightness(0.55) saturate(0.5); }

.discord-card .dc-avatar-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.discord-card .dc-avatar-wrap .dc-avatar {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.discord-card .dc-x-big,
.discord-card .dc-x-overlay {
    position: relative;
    color: #ff4d3d;
    font-size: 32px;
    font-weight: 900;
    text-shadow: 0 0 8px rgba(255, 77, 61, 0.7);
    z-index: 1;
}

.discord-card .dc-x-overlay { font-size: 28px; }

.discord-card .dc-x {
    color: #ff4d3d;
    font-weight: 900;
    margin-right: 8px;
    text-shadow: 0 0 8px rgba(255, 77, 61, 0.7);
}

.discord-card .dc-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.discord-card .dc-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.15;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discord-card .dc-title { color: #fff; }
.discord-card .dc-name { color: #fff; }

.discord-card .dc-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #c9c9d1;
    line-height: 1.2;
}

.discord-card .dc-status-text { color: #c9c9d1; }

.discord-card .dc-activity {
    font-size: 0.88rem;
    color: #ffffff;
    opacity: 0.92;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 1px;
}

.discord-card .dc-activity.dc-fallback { color: #c9c9d1; opacity: 1; }

.discord-card .dc-elapsed {
    font-size: 0.78rem;
    color: #9aa0aa;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.discord-card .dc-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6b7280;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6);
}

.discord-card .dc-dot.online { background: #43b581; box-shadow: 0 0 0 2px rgba(0,0,0,0.6), 0 0 8px #43b581; }
.discord-card .dc-dot.idle   { background: #faa61a; }
.discord-card .dc-dot.dnd    { background: #f04747; box-shadow: 0 0 0 2px rgba(0,0,0,0.6), 0 0 8px #f04747; }
.discord-card .dc-dot.offline{ background: #6b7280; }

@media (max-width: 600px) {
    .discord-card { min-width: 0; padding: 12px 14px; gap: 10px; }
    .discord-card .dc-avatar,
    .discord-card .dc-avatar-wrap { width: 46px; height: 46px; border-radius: 12px; }
    .discord-card .dc-row { font-size: 1rem; }
    .discord-card .dc-status,
    .discord-card .dc-activity { font-size: 0.8rem; }
}

/* ---------- last.fm "Now Playing" card (matches discord card) ---------- */
.lastfm-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px 14px 16px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    color: #fff;
    text-decoration: none;
    flex: 1 1 320px;
    min-width: 280px;
    max-width: 460px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease;
    position: relative;
}

.lastfm-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.lastfm-card .lf-art {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.lastfm-card .lf-art-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #aaa;
    background: rgba(255, 255, 255, 0.04);
}

.lastfm-card .lf-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lastfm-card .lf-track {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lastfm-card .lf-sub {
    font-size: 0.85rem;
    color: #c9c9d1;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lastfm-card .lf-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.72rem;
    color: #9aa0aa;
    font-variant-numeric: tabular-nums;
}
.lastfm-card .lf-bar {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    overflow: hidden;
}
.lastfm-card .lf-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: #1db954;
    transition: width 1s linear;
}

@media (max-width: 600px) {
    .lastfm-card { min-width: 0; padding: 12px 14px; gap: 10px; }
    .lastfm-card .lf-art { width: 46px; height: 46px; border-radius: 12px; }
    .lastfm-card .lf-track { font-size: 0.95rem; }
    .lastfm-card .lf-sub { font-size: 0.78rem; }
}

/* ---------- generic small pill (now-playing, etc) ---------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #eee;
    font-size: 0.85rem;
    text-decoration: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: transform .15s ease, border-color .15s ease;
}

.pill:hover { transform: translateY(-1px); border-color: var(--accent); }

.pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #888;
    flex-shrink: 0;
}

.pill .dot.online { background: #43b581; box-shadow: 0 0 6px #43b581; }
.pill .dot.idle { background: #faa61a; }
.pill .dot.dnd { background: #f04747; }
.pill .dot.live { background: #ff0000; box-shadow: 0 0 8px #ff0000; animation: livepulse 1.4s ease-in-out infinite; }

@keyframes livepulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.pill img.np-art {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    object-fit: cover;
}

/* =====================================================================
   Reaction buttons
   ===================================================================== */
.reactions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 1rem auto 0;
}

.react-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: transform .12s ease, background .15s ease, border-color .15s ease;
    user-select: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.react-btn:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: var(--accent);
}

.react-btn.mine {
    background: var(--accent-soft);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 0 14px var(--accent-glow);
}

.react-btn .count {
    margin-left: 6px;
    color: #ccc;
    font-size: 0.8rem;
}

.react-btn.bumped {
    animation: bump 0.45s ease;
}

@keyframes bump {
    0% { transform: scale(1); }
    40% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* =====================================================================
   Antarctica easter egg
   ===================================================================== */
.snowflake {
    position: fixed;
    color: #fff;
    pointer-events: none;
    z-index: 9998;
    text-shadow: 0 0 6px rgba(180, 220, 255, 0.6);
    user-select: none;
}

body.frozen::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 30%, rgba(200, 230, 255, 0.05), rgba(170, 210, 255, 0.18) 70%);
    pointer-events: none;
    z-index: 9997;
}

/* =====================================================================
   North Korea easter egg
   ===================================================================== */
.nk-overlay {
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(0, 30, 80, 0.4), rgba(140, 0, 0, 0.55)),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 10px, transparent 10px 22px);
    pointer-events: none;
    z-index: -50;
    display: none;
}

.nk-popup {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #8b0000;
    color: #fff;
    border: 3px solid #ffcc00;
    padding: 12px 22px;
    font-weight: 700;
    z-index: 1100;
    border-radius: 6px;
    box-shadow: 0 0 30px rgba(139, 0, 0, 0.8);
}

/* =====================================================================
   Vatican easter egg
   ===================================================================== */
.pope-hat {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    font-size: 32px;
    user-select: none;
}

/* =====================================================================
   Avatar click counter feedback
   ===================================================================== */
.avatar-click-toast {
    position: fixed;
    pointer-events: none;
    color: var(--accent);
    font-weight: 700;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
    z-index: 9000;
    animation: float-up 1.1s ease forwards;
    user-select: none;
}

@keyframes float-up {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-50px) scale(1.5); }
}

/* =====================================================================
   Cursed BSOD
   ===================================================================== */
.bsod-cursed {
    position: fixed;
    inset: 0;
    background: #0078d7;
    color: #fff;
    z-index: 99999;
    font-family: 'Segoe UI', sans-serif;
    padding: 8vw;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bsod-cursed h1 { font-size: 8rem; margin: 0; font-weight: 200; }
.bsod-cursed p { font-size: 1.4rem; max-width: 700px; }
.bsod-cursed .qr { margin-top: 1rem; font-size: 0.9rem; opacity: 0.85; }

/* =====================================================================
   Generic page chrome (used by /blog, /guestbook, /who, mini projects)
   ===================================================================== */
.page-shell {
    max-width: 880px;
    margin: 0 auto;
    padding: 60px 20px;
    color: #eee;
    font-family: 'Ubuntu', sans-serif;
}

.page-shell h1 {
    font-weight: 200;
    color: var(--accent);
    font-size: 3.5rem;
    margin: 0 0 1rem;
    text-shadow: 0 0 18px var(--accent-glow);
}

.page-shell h2 { font-weight: 300; }

.page-shell a { color: var(--accent); }
.page-shell a:hover { color: #fff; }

.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover { color: var(--accent); }

.card {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 14px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.card h3 { margin: 0 0 6px; }

.card .muted { color: #999; font-size: 0.85rem; }

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: 0;
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
}

.btn-primary:hover { filter: brightness(1.15); }

.input,
.textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 10px;
}

.textarea { min-height: 90px; resize: vertical; }

.input:focus,
.textarea:focus { outline: none; border-color: var(--accent); }

/* =====================================================================
   Mobile tweaks
   ===================================================================== */
@media (max-width: 600px) {
    .center h1 { font-size: 4rem !important; }
    .btns { min-width: 130px !important; height: 50px !important; font-size: 0.85rem !important; }
    .theme-switcher { top: 8px; right: 8px; }
    .pill { font-size: 0.78rem; }
}
