/* ============================================================
   LOUP-GAROU — Grimoire / TCG horror RPG
   Direction : duel de cartes gothiques sous la lune de sang
   ============================================================ */

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
html{ -webkit-text-size-adjust:100%; }

/* ---------- Tokens ---------- */
:root{
  --ink:        #0a0712;
  --ink-2:      #120c1e;
  --wood:       #160f22;
  --wood-2:     #1d1430;
  --brass:      #c9a24b;
  --brass-deep: #8a6a26;
  --brass-lite: #f0d27a;
  --blood:      #b3122b;
  --blood-lite: #e0556b;
  --bone:       #e8e0cf;
  --bone-dim:   #b8ad93;
  --arcane:     #7b54ff;
  --good:       #5bbf8f;

  --text:  var(--bone);
  --muted: var(--bone-dim);

  --frame-grad: linear-gradient(160deg,#e7c876 0%,#b88a2f 18%,#6e511c 50%,#caa24f 82%,#7a5a22 100%);
  --panel: linear-gradient(180deg, rgba(28,18,46,.92) 0%, rgba(12,8,24,.96) 100%);

  --corner: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%23e7c876' stroke-width='1.7'%3E%3Cpath d='M2 46 L2 14 Q2 2 14 2 L46 2'/%3E%3Cpath d='M7 46 Q7 18 18 11 Q30 4 46 7' stroke-width='.9' opacity='.6'/%3E%3Cpath d='M10 40 q6 -10 18 -14 q9 -3 16 -1' stroke-width='.8' opacity='.5'/%3E%3C/g%3E%3Ccircle cx='13' cy='34' r='2.4' fill='%23e7c876'/%3E%3Ccircle cx='34' cy='13' r='2.4' fill='%23e7c876'/%3E%3Cpath d='M11 18 q4 4 0 8 q-4 -4 0 -8z' fill='%23caa24f'/%3E%3C/svg%3E");
  --crest: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23e7c876' stroke-width='1.6'%3E%3Cpath d='M32 6 C20 6 12 14 12 26 C12 42 32 58 32 58 C32 58 52 42 52 26 C52 14 44 6 32 6 Z'/%3E%3Cpath d='M32 14 C26 14 22 18 22 26 C22 36 32 48 32 48' stroke-width='.8' opacity='.55'/%3E%3C/g%3E%3Ccircle cx='32' cy='26' r='4' fill='%23e7c876'/%3E%3C/svg%3E");
}

body{
  font-family:'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color:var(--text);
  min-height:100vh; min-height:100dvh;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overflow-x:hidden;
  position:relative;
  background:
    radial-gradient(1200px 720px at 22% -8%, #241544 0%, transparent 60%),
    radial-gradient(900px 700px at 100% 110%, #2a0d18 0%, transparent 60%),
    linear-gradient(180deg,#0c0818 0%, #07050f 100%);
  background-attachment:fixed;
  transition:background 900ms ease;
}

/* atmosphere : le village sous la pleine lune, dark horror, omniprésent */
body::before{
  content:""; position:fixed; inset:0; z-index:-3;
  background-image:url('img/bg-night.png');
  background-size:cover; background-position:center 28%; background-repeat:no-repeat;
  opacity:.66; transition:opacity 1.2s ease, filter 1s ease;
  filter:saturate(.9) contrast(1.05) brightness(.9);
}
body.phase-day::before, body.phase-vote::before{ filter:saturate(.85) contrast(1.04) brightness(1.02) sepia(.12); opacity:.6; }
body.phase-end::before{ opacity:.55; filter:saturate(.8) contrast(1.05) brightness(.7); }
/* halo de lune en haut + vignette horror pour la lisibilité */
body::after{
  content:""; position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:
    radial-gradient(60% 38% at 50% 6%, rgba(190,205,255,.16), transparent 70%),
    radial-gradient(140% 100% at 50% -8%, transparent 30%, rgba(4,2,10,.55) 72%, rgba(2,1,6,.82) 100%);
}
body.phase-day, body.phase-vote{ --text:#efe7d4; }
body.phase-day::after, body.phase-vote::after{
  background:
    radial-gradient(60% 40% at 50% 6%, rgba(255,224,170,.14), transparent 70%),
    radial-gradient(140% 100% at 50% -8%, transparent 32%, rgba(8,4,12,.5) 74%, rgba(3,1,7,.8) 100%);
}

/* drifting embers / dust */
.stars{
  position:fixed; inset:0; pointer-events:none; z-index:0;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 30%, rgba(240,210,122,.55), transparent 60%),
    radial-gradient(1.2px 1.2px at 70% 18%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(1.6px 1.6px at 84% 64%, rgba(240,210,122,.5), transparent 60%),
    radial-gradient(1px 1px at 40% 78%, rgba(255,255,255,.4), transparent 60%),
    radial-gradient(1.2px 1.2px at 26% 56%, rgba(240,210,122,.4), transparent 60%);
  opacity:.7; animation:drift 9s ease-in-out infinite;
}
@keyframes drift{ 0%,100%{ transform:translateY(0); filter:brightness(1);} 50%{ transform:translateY(-6px); filter:brightness(1.5);} }

/* ============================================================
   Topbar
   ============================================================ */
.topbar{
  position:sticky; top:0; z-index:30;
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 16px;
  background:linear-gradient(180deg, rgba(8,5,16,.92), rgba(8,5,16,.6));
  border-bottom:1px solid rgba(201,162,75,.35);
  backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
}
.brand{ display:flex; align-items:center; gap:10px; }
.brand-emoji{ font-size:22px; filter:drop-shadow(0 0 8px rgba(179,18,43,.6)); }
.brand-name{
  font-family:'Cinzel Decorative','Cinzel',serif; font-weight:900; letter-spacing:1.5px;
  font-size:18px;
  background:linear-gradient(180deg,var(--brass-lite),var(--brass) 55%,var(--brass-deep));
  -webkit-background-clip:text; background-clip:text; color:transparent;
  text-shadow:0 0 22px rgba(201,162,75,.25);
}
.top-actions{ display:flex; gap:8px; }
.icon-btn{
  width:38px; height:38px; border-radius:9px; cursor:pointer;
  border:1px solid rgba(201,162,75,.4);
  background:linear-gradient(180deg,#211634,#140d24);
  color:var(--bone); font-size:17px; line-height:1;
  display:inline-flex; align-items:center; justify-content:center;
  transition:transform .15s, border-color .2s, box-shadow .2s;
}
.icon-btn:hover{ transform:translateY(-1px); border-color:var(--brass-lite); box-shadow:0 0 14px rgba(201,162,75,.3); }
.icon-btn.muted{ opacity:.5; }
.icon-btn.active{ border-color:var(--brass-lite); box-shadow:0 0 0 2px rgba(201,162,75,.25); }

/* ============================================================
   Layout
   ============================================================ */
.app{
  position:relative; z-index:1;
  max-width:1040px; margin:0 auto;
  padding:22px 16px calc(150px + env(safe-area-inset-bottom,0px));
}
.screen{ display:none; animation:rise .4s ease; }
.screen.active{ display:block; }
@keyframes rise{ from{ opacity:0; transform:translateY(10px);} to{ opacity:1; transform:none;} }
.row{ display:flex; gap:10px; flex-wrap:wrap; justify-content:center; margin-top:18px; }

/* ============================================================
   Home
   ============================================================ */
.hero{ text-align:center; padding:30px 0 8px; }
.title{
  font-family:'Cinzel Decorative','Cinzel',serif; font-weight:900;
  font-size:clamp(46px,9vw,82px); line-height:.95; margin:0 0 14px;
  letter-spacing:2px;
  background:linear-gradient(180deg,#f6e3a6 0%,#caa24f 42%,#7a5a22 100%);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  text-shadow:0 0 40px rgba(179,18,43,.35);
  filter:drop-shadow(0 6px 12px rgba(0,0,0,.6));
}
.subtitle{
  color:var(--muted); margin:0 auto 8px; max-width:520px;
  font-family:'Spectral',serif; font-style:italic; font-size:17px; letter-spacing:.3px;
}
.modes{
  display:grid; gap:16px; grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
  max-width:660px; margin:26px auto 6px;
}
.mode-card{
  cursor:pointer; text-align:center; color:var(--bone);
  padding:26px 18px 22px; border-radius:14px; position:relative;
  background:var(--panel);
  border:1px solid rgba(201,162,75,.4);
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.5), inset 0 0 30px rgba(201,162,75,.06), 0 12px 30px rgba(0,0,0,.5);
  transition:transform .2s, border-color .2s, box-shadow .2s;
}
.mode-card:hover{ transform:translateY(-3px); border-color:var(--brass-lite); box-shadow:inset 0 0 0 1px rgba(0,0,0,.5), 0 0 26px rgba(201,162,75,.22), 0 16px 34px rgba(0,0,0,.55); }
.mode-emoji{ font-size:34px; margin-bottom:8px; }
.mode-title{ font-family:'Cinzel',serif; font-size:21px; font-weight:700; letter-spacing:.5px; color:var(--brass-lite); }
.mode-sub{ color:var(--muted); font-size:13.5px; margin-top:6px; font-family:'Spectral',serif; }

.link-btn{
  display:inline-block; margin:22px auto 0; cursor:pointer;
  background:transparent; border:none; color:var(--brass);
  font-family:'Cinzel',serif; font-size:13px; letter-spacing:.6px;
  text-decoration:underline; text-underline-offset:3px;
}

/* ============================================================
   Setup
   ============================================================ */
.section-title{
  font-family:'Cinzel',serif; text-align:center; margin:10px 0 20px;
  font-size:27px; color:var(--brass-lite); letter-spacing:1px;
}
.name-inputs{ display:grid; gap:14px; max-width:500px; margin:0 auto; }
.name-row label{ color:var(--muted); font-size:12px; font-family:'Cinzel',serif; letter-spacing:.5px; display:block; margin-bottom:5px; }
.name-row-fields{ display:flex; gap:8px; }
.name-inputs input{
  flex:1; padding:13px 14px; border-radius:10px; font-size:15px; font-family:inherit;
  background:linear-gradient(180deg,#1b1230,#120c22); color:var(--bone);
  border:1px solid rgba(201,162,75,.35);
}
.name-inputs input:focus{ outline:none; border-color:var(--brass-lite); box-shadow:0 0 0 2px rgba(201,162,75,.2); }
.gender-select{
  padding:13px 10px; border-radius:10px; min-width:108px; font-size:14px; font-family:inherit; cursor:pointer;
  background:linear-gradient(180deg,#1b1230,#120c22); color:var(--bone);
  border:1px solid rgba(201,162,75,.35);
}
.gender-select:focus{ outline:none; border-color:var(--brass-lite); }

/* ============================================================
   Buttons (engraved brass)
   ============================================================ */
.btn-primary{
  cursor:pointer; font-family:'Cinzel',serif; font-weight:700; letter-spacing:.6px; font-size:14.5px;
  color:#241405; padding:12px 22px; border-radius:10px;
  background:linear-gradient(180deg,#f1d680 0%,#c79f43 45%,#9a7426 100%);
  border:1px solid #5e4416;
  text-shadow:0 1px 0 rgba(255,255,255,.35);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.45), inset 0 -2px 6px rgba(90,60,12,.5), 0 6px 16px rgba(0,0,0,.5);
  transition:transform .14s, filter .2s, box-shadow .2s;
}
.btn-primary:hover{ transform:translateY(-1px); filter:brightness(1.06); box-shadow:inset 0 1px 0 rgba(255,255,255,.5), 0 0 20px rgba(201,162,75,.4), 0 8px 20px rgba(0,0,0,.5); }
.btn-primary:disabled{ opacity:.5; cursor:not-allowed; transform:none; }
.btn-ghost{
  cursor:pointer; font-family:'Cinzel',serif; letter-spacing:.4px; font-size:14px;
  color:var(--bone); padding:12px 18px; border-radius:10px;
  background:linear-gradient(180deg,#211634,#150e26);
  border:1px solid rgba(201,162,75,.4);
  transition:border-color .2s, box-shadow .2s, transform .14s;
}
.btn-ghost:hover{ border-color:var(--brass-lite); transform:translateY(-1px); box-shadow:0 0 16px rgba(201,162,75,.25); }

/* ============================================================
   Phase ribbon
   ============================================================ */
.phase-card{
  display:flex; align-items:center; gap:14px; margin:4px 0 16px;
  padding:12px 18px; border-radius:13px;
  background:var(--panel);
  border:1px solid rgba(201,162,75,.4);
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.45);
}
.phase-emoji{ font-size:34px; line-height:1; animation:float 3.4s ease-in-out infinite; filter:drop-shadow(0 0 10px rgba(201,162,75,.4)); }
@keyframes float{ 0%,100%{ transform:translateY(0);} 50%{ transform:translateY(-4px);} }
.phase-title{ font-family:'Cinzel',serif; font-size:20px; font-weight:700; letter-spacing:.6px; color:var(--brass-lite); }
.phase-sub{ color:var(--muted); font-size:13.5px; margin-top:2px; font-family:'Spectral',serif; font-style:italic; }

/* ============================================================
   STAGE — the spotlight (signature element)
   ============================================================ */
.stage{
  position:relative; margin:0 0 18px; padding:26px 14px 10px;
  border-radius:16px; min-height:60px;
  display:none;
}
.stage.show{ display:block; animation:rise .4s ease; }
/* candle-lit dais glow */
.stage::before{
  content:""; position:absolute; left:50%; top:8px; transform:translateX(-50%);
  width:min(420px,86%); height:300px; pointer-events:none; z-index:0;
  background:radial-gradient(60% 55% at 50% 38%, rgba(201,162,75,.22), transparent 70%);
}
.stage-inner{ position:relative; z-index:1; display:flex; flex-direction:column; align-items:center; gap:14px; }

/* prompt (non-card moments: night, vote) */
.stage-prompt{ text-align:center; max-width:440px; }
.stage-prompt .sp-emoji{ font-size:54px; filter:drop-shadow(0 0 18px rgba(179,18,43,.5)); animation:float 3.4s ease-in-out infinite; }
.stage-prompt .sp-title{ font-family:'Cinzel',serif; font-size:22px; font-weight:700; color:var(--brass-lite); margin-top:6px; letter-spacing:.8px; }
.stage-prompt .sp-sub{ font-family:'Spectral',serif; font-style:italic; color:var(--muted); margin-top:6px; font-size:15px; }

/* speech ribbon */
.speech{
  position:relative; max-width:520px; width:100%;
  padding:16px 22px; border-radius:6px;
  background:linear-gradient(180deg,#efe2c0 0%,#e2cf9e 100%);
  color:#2c2012; font-family:'Spectral',serif; font-style:italic; font-size:16.5px; line-height:1.5;
  text-align:center;
  box-shadow:0 10px 26px rgba(0,0,0,.5), inset 0 0 0 1px rgba(120,86,30,.4), inset 0 0 22px rgba(120,86,30,.12);
  animation:unfurl .45s ease both;
  clip-path:polygon(0 8px,8px 0,calc(100% - 8px) 0,100% 8px,100% calc(100% - 8px),calc(100% - 8px) 100%,8px 100%,0 calc(100% - 8px));
}
.speech::before, .speech::after{ content:""; position:absolute; top:50%; width:18px; height:30px; transform:translateY(-50%);
  background:linear-gradient(180deg,#c79f43,#7a5a22); clip-path:polygon(0 0,100% 18%,100% 82%,0 100%); }
.speech::before{ left:-15px; clip-path:polygon(100% 0,0 18%,0 82%,100% 100%); }
.speech::after{ right:-15px; }
.speech .sp-name{ display:block; font-style:normal; font-family:'Cinzel',serif; font-weight:700; font-size:12px; letter-spacing:1px; text-transform:uppercase; color:#7a5a22; margin-bottom:6px; }
@keyframes unfurl{ from{ opacity:0; transform:scaleX(.6); } to{ opacity:1; transform:scaleX(1);} }

/* ============================================================
   CARD — original gothic frame
   ============================================================ */
.card{
  position:relative; width:144px; flex:0 0 auto;
  border-radius:13px; padding:6px;
  background:var(--frame-grad);
  box-shadow:0 8px 22px rgba(0,0,0,.6), inset 0 0 0 1px rgba(60,40,10,.6), inset 0 2px 0 rgba(255,240,200,.5);
  transition:transform .2s, box-shadow .25s, filter .3s, opacity .3s;
}
.card-frame{
  position:relative; border-radius:8px; overflow:hidden;
  background:linear-gradient(180deg,#1c1330,#0f0a1d);
  box-shadow:inset 0 0 0 1px rgba(231,200,118,.7), inset 0 0 0 3px rgba(20,12,8,.9), inset 0 0 22px rgba(0,0,0,.7);
}
/* filigrane des 4 coins */
.card-frame::before, .card-frame::after{
  content:""; position:absolute; width:26px; height:26px; z-index:4; pointer-events:none;
  background:var(--corner) center/contain no-repeat; opacity:.95;
}
.card-frame::before{ top:2px; left:2px; }
.card-frame::after{ top:2px; right:2px; transform:scaleX(-1); }

.card-name{
  position:relative; z-index:2; text-align:center;
  font-family:'Cinzel',serif; font-weight:700; letter-spacing:.5px;
  font-size:12.5px; color:#f4e2ad;
  padding:6px 20px 5px;
  background:linear-gradient(180deg,#2c1d12 0%,#1a1108 100%);
  border-bottom:1px solid rgba(231,200,118,.55);
  box-shadow:inset 0 1px 0 rgba(255,235,180,.18);
  text-shadow:0 1px 3px rgba(0,0,0,.8);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.card-art{
  position:relative; aspect-ratio:5/6; overflow:hidden;
  /* décor par défaut = le village sous la lune (référence) */
  background:url('img/bg-night.png') center 30%/cover no-repeat, linear-gradient(180deg,#1b1538,#0c0818);
  display:flex; align-items:center; justify-content:center;
}
.card-art::before{ /* assombrit le décor pour faire ressortir le personnage */
  content:""; position:absolute; inset:0;
  background:radial-gradient(70% 60% at 50% 42%, rgba(8,5,18,.15), rgba(6,3,14,.78) 100%);
}
/* médaillon de personnage (cartes face cachée) */
.medallion{
  position:relative; z-index:2; width:62%; aspect-ratio:1;
  border-radius:50%;
  background:radial-gradient(circle at 50% 38%, #2a1f4d 0%, #120c22 70%);
  box-shadow:0 0 0 2px #e7c876, 0 0 0 5px rgba(20,12,8,.9), inset 0 4px 14px rgba(0,0,0,.7), 0 0 22px rgba(123,84,255,.25);
  display:flex; align-items:center; justify-content:center;
}
.medallion .portrait{ font-size:42px; line-height:1; filter:drop-shadow(0 4px 8px rgba(0,0,0,.8)); }
.card-seal{
  position:absolute; left:50%; bottom:7px; transform:translateX(-50%); z-index:3;
  font-family:'Cinzel',serif; font-size:8.5px; letter-spacing:1.6px; text-transform:uppercase;
  color:#e7c876; opacity:.85; text-shadow:0 1px 2px rgba(0,0,0,.9);
}
.card-art .crest{
  position:absolute; top:8px; left:50%; transform:translateX(-50%); z-index:3;
  width:22px; height:22px; background:var(--crest) center/contain no-repeat; opacity:.5;
}
.card-type{
  position:relative; z-index:2; text-align:center;
  font-family:'Cinzel',serif; font-weight:600; font-size:10.5px; letter-spacing:.6px;
  color:#e7d3a0;
  padding:5px 8px 6px;
  background:linear-gradient(180deg,#1a1108 0%,#2c1d12 100%);
  border-top:1px solid rgba(231,200,118,.55);
  box-shadow:inset 0 1px 0 rgba(255,235,180,.14);
}

/* states */
.card.human{ filter:drop-shadow(0 0 8px rgba(241,196,15,.35)); }
.card.human .card-name{ color:#ffe39a; }
.card.selectable{ cursor:pointer; animation:beckon 1.5s ease-in-out infinite; }
@keyframes beckon{
  0%,100%{ box-shadow:0 8px 20px rgba(0,0,0,.55), 0 0 0 0 rgba(224,85,107,.55); }
  50%{ box-shadow:0 8px 20px rgba(0,0,0,.55), 0 0 0 7px rgba(224,85,107,0); }
}
.card.selectable:hover{ transform:translateY(-3px); }
.card.selected{ transform:translateY(-3px); box-shadow:0 10px 24px rgba(0,0,0,.6), 0 0 0 3px var(--blood-lite); }
.card.speaking{
  transform:translateY(-4px) scale(1.03);
  box-shadow:0 12px 30px rgba(0,0,0,.6), 0 0 26px rgba(201,162,75,.5);
}
.card.speaking .card-frame{ box-shadow:inset 0 0 0 1px rgba(240,210,122,.9), inset 0 0 22px rgba(201,162,75,.25); }

/* dead / revealed */
.card.dead{ filter:grayscale(.65) brightness(.82); opacity:.72; }
.card.dead .card-art::after{
  content:"☠"; position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-size:54px; color:rgba(179,18,43,.9); text-shadow:0 2px 10px rgba(0,0,0,.9); z-index:5;
}
/* carte retournée : l'illustration de rôle remplit la fenêtre */
.card.revealed .card-art{
  background:#0c0818 center/cover no-repeat;
  background-image:var(--role-art, none);
}
.card.revealed .card-art::before{ background:radial-gradient(85% 80% at 50% 30%, transparent 58%, rgba(6,3,14,.45) 100%); }
.card.revealed .medallion,
.card.revealed .card-seal,
.card.revealed .crest{ display:none; }

/* big card on stage */
.card.big{ width:clamp(200px,58vw,278px); padding:7px; }
.card.big .card-name{ font-size:16px; padding:9px 22px 8px; }
.card.big .medallion .portrait{ font-size:76px; }
.card.big .card-seal{ font-size:10px; bottom:10px; }
.card.big .crest{ width:30px; height:30px; }
.card.big .card-type{ font-size:12.5px; padding:7px 10px 8px; }
.card.big .card-frame::before, .card.big .card-frame::after{ width:34px; height:34px; }
.card.big.reveal-anim{ animation:flipReveal .6s ease both; }
@keyframes flipReveal{
  0%{ transform:rotateY(90deg) scale(.96); opacity:0; }
  60%{ transform:rotateY(-8deg) scale(1.02); opacity:1; }
  100%{ transform:rotateY(0) scale(1); }
}

/* ============================================================
   Player rail (the village)
   ============================================================ */
.board{ margin-bottom:10px; }
.players{
  display:flex; flex-wrap:wrap; gap:12px; justify-content:center;
}
.rail-label{
  text-align:center; font-family:'Cinzel',serif; font-size:11px; letter-spacing:2px;
  text-transform:uppercase; color:var(--brass); opacity:.7; margin:2px 0 12px;
}

/* ============================================================
   Action bar / 3 choices
   ============================================================ */
.action-bar{
  margin:18px 0; display:flex; gap:10px; flex-wrap:wrap; justify-content:center; min-height:44px;
}
.action-bar .info{
  font-family:'Spectral',serif; font-style:italic; font-size:14.5px; color:var(--muted);
  display:inline-flex; align-items:center; padding:8px 4px; text-align:center; width:100%; justify-content:center;
}
.action-bar .btn-primary{ padding:11px 20px; }
.action-bar .btn-ghost{ padding:11px 16px; }

/* choices grid */
.choices{ display:grid; gap:10px; width:100%; max-width:620px; grid-template-columns:1fr; }
.choice{
  position:relative; cursor:pointer; text-align:left;
  padding:14px 16px 14px 48px; border-radius:10px;
  background:linear-gradient(180deg,#241634 0%,#150e26 100%);
  border:1px solid rgba(201,162,75,.45);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05), 0 5px 14px rgba(0,0,0,.45);
  transition:transform .14s, border-color .2s, box-shadow .2s;
}
.choice:hover{ transform:translateY(-2px); border-color:var(--brass-lite); box-shadow:0 0 18px rgba(201,162,75,.28), 0 8px 18px rgba(0,0,0,.5); }
.choice:disabled{ opacity:.45; cursor:not-allowed; transform:none; }
.choice .c-glyph{ position:absolute; left:14px; top:50%; transform:translateY(-50%); font-size:20px; }
.choice .c-label{ font-family:'Cinzel',serif; font-weight:700; font-size:12px; letter-spacing:.5px; color:var(--brass-lite); display:block; margin-bottom:3px; }
.choice .c-line{ font-family:'Spectral',serif; font-style:italic; font-size:14.5px; color:var(--bone); line-height:1.35; }
.choice.tone-accuse{ border-color:rgba(224,85,107,.5); }
.choice.tone-accuse .c-label{ color:var(--blood-lite); }
.choice.tone-defend .c-label{ color:var(--good); }
.choice.tone-arcane .c-label{ color:#b9a4ff; }
.choice-skip{
  margin-top:2px; background:transparent; border:none; cursor:pointer;
  color:var(--muted); font-family:'Spectral',serif; font-style:italic; font-size:13px;
  text-decoration:underline; text-underline-offset:3px; justify-self:center;
}
.choice-skip:hover{ color:var(--bone); }

/* potions banner for the witch */
.potions-banner{
  width:100%; max-width:380px; aspect-ratio:1408/768; margin:0 auto 4px;
  border-radius:10px; background:url('img/potions.png') center/cover no-repeat;
  box-shadow:0 8px 22px rgba(0,0,0,.5), inset 0 0 0 1px rgba(201,162,75,.4);
}

/* ============================================================
   Journal
   ============================================================ */
.log-wrap{
  margin-top:16px; border-radius:13px; padding:12px 16px;
  background:var(--panel);
  border:1px solid rgba(201,162,75,.35);
}
.log-head{
  display:flex; justify-content:space-between; align-items:center; margin-bottom:8px;
  font-family:'Cinzel',serif; font-size:12px; letter-spacing:1px; color:var(--brass);
}
.log{ max-height:190px; overflow-y:auto; font-size:14px; line-height:1.55; font-family:'Spectral',serif; }
.log .line{ padding:4px 0; border-bottom:1px dashed rgba(201,162,75,.18); }
.log .line:last-child{ border-bottom:none; }
.log .line.night{ color:#a99fcf; }
.log .line.day{ color:var(--bone); }
.log .line.vote{ color:var(--brass-lite); font-weight:600; }
.log .line.death{ color:var(--blood-lite); font-weight:600; }
.log .line.win{ color:var(--good); font-weight:700; }
.log strong{ color:var(--brass-lite); font-style:normal; }

/* ============================================================
   Modals
   ============================================================ */
.modal{
  position:fixed; inset:0; z-index:60; padding:20px;
  background:rgba(6,3,14,.72); display:none; align-items:center; justify-content:center;
  backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px);
}
.modal.open{ display:flex; animation:rise .25s ease; }
.modal-card{
  width:100%; max-width:520px; max-height:85vh; overflow-y:auto; border-radius:14px;
  background:linear-gradient(180deg,#1b1230,#120c22); color:var(--bone);
  border:1px solid rgba(201,162,75,.45);
  box-shadow:0 24px 70px rgba(0,0,0,.6), inset 0 0 0 1px rgba(0,0,0,.4);
}
.modal-head{
  display:flex; justify-content:space-between; align-items:center; padding:16px 20px;
  border-bottom:1px solid rgba(201,162,75,.3);
}
.modal-head h3{ margin:0; font-family:'Cinzel',serif; font-size:18px; color:var(--brass-lite); letter-spacing:.6px; }
.modal-close{ background:transparent; border:none; cursor:pointer; font-size:18px; color:var(--bone); opacity:.6; }
.modal-close:hover{ opacity:1; }
.modal-body{ padding:18px 20px; font-size:14.5px; line-height:1.65; font-family:'Spectral',serif; }
.modal-body p{ margin:0 0 12px; }
.modal-body strong{ color:var(--brass-lite); font-family:'Cinzel',serif; letter-spacing:.4px; }
.modal-body em{ color:var(--bone); }

/* music */
.music-list{ display:grid; gap:8px; }
.music-item{
  display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:10px; cursor:pointer;
  background:rgba(255,255,255,.04); border:1px solid rgba(201,162,75,.2);
  transition:border-color .2s, background .2s;
}
.music-item:hover{ border-color:var(--brass); }
.music-item.active{ border-color:var(--brass-lite); background:rgba(201,162,75,.12); }
.music-item .m-emoji{ font-size:20px; }
.music-item .m-text{ flex:1; min-width:0; }
.music-item .m-title{ font-family:'Cinzel',serif; font-weight:600; font-size:14px; }
.music-item .m-sub{ font-size:12px; opacity:.7; margin-top:2px; }
.music-item .m-state{ font-size:12px; opacity:.6; }
.music-item.active .m-state{ color:var(--brass-lite); opacity:1; font-weight:600; }
.music-volume{ display:flex; align-items:center; gap:10px; margin-top:14px; padding-top:12px; border-top:1px solid rgba(201,162,75,.25); font-size:13px; }
.music-volume input{ flex:1; accent-color:var(--brass); }
.music-hint{ font-size:12px; opacity:.7; margin-top:12px; }
.music-hint code{ background:rgba(255,255,255,.08); padding:1px 5px; border-radius:4px; font-size:11.5px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width:520px){
  .topbar{ padding:10px 12px; }
  .app{ padding:16px 12px calc(160px + env(safe-area-inset-bottom,0px)); }
  .card{ width:108px; }
  .players{ gap:9px; }
  .phase-title{ font-size:17px; }
  .log{ max-height:150px; }
}

/* sticky action bar on phones so choices are always reachable */
@media (max-width:760px){
  .action-bar{
    position:fixed; left:0; right:0; bottom:0; margin:0; z-index:40;
    padding:12px 12px calc(12px + env(safe-area-inset-bottom,0px));
    background:linear-gradient(180deg, rgba(10,7,18,.86), rgba(10,7,18,.96));
    border-top:1px solid rgba(201,162,75,.35);
    backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
    max-height:62vh; overflow-y:auto;
  }
  .action-bar:empty{ display:none; }
}

@media (prefers-reduced-motion:reduce){
  *{ animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.05ms !important; }
}
