:root {
    --bg: #0a0a0a;
    --panel: #141414;
    --panel-2: #1a1a1a;
    --border: #2a2a2a;
    --border-soft: #1f1f1f;
    --ink: #d4d4d4;
    --ink-dim: #707070;
    --ink-faint: #404040;
    --cherry: #ef4444;
    --cherry-glow: rgba(239, 68, 68, 0.55);
    --paper: #ede4d3;
    --filter: #c4955c;
    --filter-dark: #8b6638;
    --ash: #7a7672;
}

html, body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'JetBrains Mono', 'Noto Sans JP', monospace;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
}

.font-jp { font-family: 'Noto Sans JP', 'JetBrains Mono', monospace; }
.font-display { font-family: 'Shippori Mincho', serif; }

.sky {
    position: absolute; inset: 0;
    transition: background 2s ease;
    pointer-events: none;
}
.sky-morning   { background: linear-gradient(180deg, #1a2540 0%, #2a3552 40%, #0a0a0a 100%); }
.sky-noon      { background: linear-gradient(180deg, #2a3a4a 0%, #1a242e 40%, #0a0a0a 100%); }
.sky-afternoon { background: linear-gradient(180deg, #3a2820 0%, #251a18 40%, #0a0a0a 100%); }
.sky-evening   { background: linear-gradient(180deg, #4a1f1a 0%, #2a1410 40%, #0a0a0a 100%); }
.sky-night     { background: linear-gradient(180deg, #0d1525 0%, #0a0e18 40%, #050505 100%); }
.sky-latenight { background: linear-gradient(180deg, #050810 0%, #08080c 40%, #000 100%); }

.sky::after {
    content: '';
    position: absolute;
    top: 10%; right: 15%;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 220, 150, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

@keyframes smoke-rise {
    0%   { transform: translate(0, 0) scale(0.6); opacity: 0; }
    15%  { opacity: 0.5; }
    100% { transform: translate(var(--drift, -8px), -90px) scale(2.4); opacity: 0; }
}
.smoke-particle {
    position: absolute;
    bottom: 50%;
    left: 50%;
    width: 8px; height: 8px;
    background-color: #aaa;
    border-radius: 50%;
    filter: blur(3px);
    animation: smoke-rise 3.5s ease-out forwards;
    pointer-events: none;
}
.smoke-menthol { background-color: #b8d4d0; }
.smoke-cigar   { background-color: #b89e84; filter: blur(4px); }

@keyframes ash-fall {
    0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    40%  { transform: translate(0, 30px) rotate(-8deg); opacity: 0.9; }
    100% { transform: translate(var(--target-x, -5px), var(--target-y, 65px)) rotate(-18deg); opacity: 0; }
}
.falling-ash {
    position: absolute;
    top: 0; left: 100%;
    height: 18px;
    background: linear-gradient(to bottom, #8a8580, #5a5550);
    border-radius: 0 2px 2px 0;
    pointer-events: none;
    z-index: 20;
}

.cherry-glow {
    background: radial-gradient(ellipse at center, #fef3c7 0%, #fbbf24 20%, #ef4444 50%, #991b1b 90%) !important;
    box-shadow:
        0 0 12px 2px var(--cherry-glow),
        0 0 28px 6px rgba(239, 68, 68, 0.25);
    animation: cherry-pulse 1.8s ease-in-out infinite;
}
@keyframes cherry-pulse {
    0%, 100% { box-shadow: 0 0 12px 2px var(--cherry-glow), 0 0 28px 6px rgba(239, 68, 68, 0.25); }
    50%      { box-shadow: 0 0 8px 1px var(--cherry-glow),  0 0 20px 4px rgba(239, 68, 68, 0.15); }
}

.ashtray-outer {
    border-radius: 50%;
    background: linear-gradient(135deg, #2a2a2a 0%, #1c1c1c 100%);
    box-shadow:
        0 4px 0 #0a0a0a,
        inset 0 1px 0 rgba(255,255,255,0.04);
}
.ashtray-inner {
    border-radius: 50%;
    background: radial-gradient(ellipse at center, #0c0c0c 0%, #050505 100%);
    box-shadow: inset 0 3px 8px rgba(0,0,0,0.9);
    position: relative;
    overflow: hidden;
}

.accumulated-ash {
    position: absolute;
    background: linear-gradient(to right, #6a6660, #8a8580, #6a6660);
    border-radius: 1px;
    opacity: 0.85;
}
.cigarette-butt {
    position: absolute;
    display: flex; align-items: center;
    opacity: 0.92;
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.5));
}

@keyframes flame-flicker {
    0%   { transform: scaleY(1) scaleX(1); opacity: 0.95; }
    25%  { transform: scaleY(1.15) scaleX(0.9) skewX(3deg); opacity: 1; }
    50%  { transform: scaleY(0.85) scaleX(1.1) skewX(-3deg); opacity: 0.8; }
    75%  { transform: scaleY(1.08) scaleX(0.95) skewX(2deg); opacity: 0.95; }
    100% { transform: scaleY(1) scaleX(1); opacity: 0.95; }
}
.lighter-container {
    position: absolute;
    right: -28px; bottom: -38px;
    display: flex; flex-direction: column; align-items: center;
    z-index: 30;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.lighter-body {
    width: 16px; height: 28px;
    background: linear-gradient(to bottom, #5a5a5a 0%, #2a2a2a 100%);
    border-radius: 2px;
    border: 1px solid #1a1a1a;
    position: relative;
}
.lighter-body::before {
    content: '';
    position: absolute;
    top: -7px; left: 2px;
    width: 12px; height: 7px;
    background: linear-gradient(to bottom, #8a8a8a, #4a4a4a);
    border-radius: 2px 2px 0 0;
}
.lighter-flame {
    width: 10px; height: 20px;
    background: linear-gradient(to bottom, transparent 0%, #fde68a 30%, #fb923c 60%, #1e40af 95%);
    border-radius: 50% 50% 20% 20%;
    margin-bottom: 2px;
    animation: flame-flicker 0.12s infinite alternate;
    box-shadow: 0 0 20px 4px rgba(251, 191, 36, 0.5);
    filter: blur(0.3px);
}
.show-lighter { opacity: 1; }

@keyframes rain-fall {
    0%   { transform: translateY(-20px); opacity: 0; }
    10%  { opacity: 0.6; }
    100% { transform: translateY(280px); opacity: 0; }
}
.raindrop {
    position: absolute;
    width: 1px; height: 14px;
    background: linear-gradient(to bottom, transparent, rgba(180, 200, 220, 0.5));
    animation: rain-fall linear infinite;
    pointer-events: none;
}

.fog-layer {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 60%, rgba(150,150,160,0.08), transparent 60%),
                radial-gradient(ellipse at 70% 40%, rgba(150,150,160,0.06), transparent 60%);
    pointer-events: none;
    animation: fog-drift 18s ease-in-out infinite alternate;
}
@keyframes fog-drift {
    0%   { transform: translateX(-10px); }
    100% { transform: translateX(10px); }
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

@keyframes msg-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.msg-anim { animation: msg-in 0.3s ease-out; }

.ambient-line {
    color: var(--ink-faint);
    font-style: italic;
    font-size: 11px;
    text-align: center;
    padding: 2px 8px;
}

.btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--ink);
    transition: all 0.15s ease;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
}
.btn:hover:not(:disabled) {
    background: #1a1a1a;
    border-color: #404040;
    color: #fff;
}
.btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}
.btn-active {
    background: #1a1a1a;
    border-color: #555;
    color: #fff;
}

.info-pill {
    font-size: 10px;
    color: var(--ink-dim);
    letter-spacing: 0.1em;
}

/* === 参加者ピル === */
.peer-pill {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--ink);
    background: #1a1a1a;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.peer-pill .peer-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor;
}
.peer-pill.speaking {
    box-shadow: 0 0 0 1px currentColor, 0 0 8px rgba(255,255,255,0.2);
}

/* === 他プレイヤーのタバコ表示 === */
.peer-cig {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    opacity: 0.85;
    transform: scale(0.55);
    transform-origin: top center;
}
.peer-cig .peer-name {
    font-size: 9px;
    color: var(--ink-dim);
    letter-spacing: 0.1em;
}
.peer-cig .mini-cig {
    display: flex; align-items: center;
    height: 12px;
}
.peer-cig .mini-cig .mc-filter { width: 12px; height: 6px; background: var(--filter); }
.peer-cig .mini-cig .mc-paper  { background: var(--paper); height: 6px; transition: width 0.5s; }
.peer-cig .mini-cig .mc-cherry { width: 4px; height: 6px; background: #1a1a1a; border-radius: 0 1px 1px 0; }
.peer-cig.lit .mini-cig .mc-cherry { background: radial-gradient(ellipse at center, #fbbf24 0%, #ef4444 70%); box-shadow: 0 0 4px 1px rgba(239,68,68,0.5); }

/* === チャットバブル === */
.bubble-me {
    max-width: 80%;
    background: #262626;
    color: #eee;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #333;
}
.bubble-peer {
    max-width: 80%;
    background: #1a1a1a;
    color: #ccc;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #2a2a2a;
}
.bubble-system {
    text-align: center;
    color: var(--ink-faint);
    font-size: 11px;
    font-style: italic;
}
