:root{
  --bg:#070810;
  --white:#f7f5f1;
  --muted:#a8adba;
  --amber:#ef9f27;
  --amber2:#c87708;
  --red:#a32d2d;
  --red2:#701b25;
  --green:#138065;

  --pad:20px;
  --radius-btn:20px;
  --radius-card:28px;
}

*{
  box-sizing:border-box;
}

html,
body{
  margin:0;
  width:100%;
  min-height:100%;
  background:#080910;
  color:var(--white);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button{
  font:inherit;
  -webkit-tap-highlight-color:transparent;
}

button:active{
  transform:scale(.96);
}

button:disabled{
  opacity:.35;
  pointer-events:none;
}

body{
  overflow:hidden;
}

.desktop-stage{
  width:100vw;
  height:100vh;
  display:grid;
  place-items:center;
  background:
    radial-gradient(circle at 50% 45%, #111522 0%, #06070c 60%);
  overflow:hidden;
}

.device{
  position:relative;
  width:390px;
  height:844px;
  transform-origin:center;
  overflow:hidden;
  background:#080912;
  box-shadow:
    0 30px 100px rgba(0,0,0,.7);
}

.game,
.screen{
  width:100%;
  height:100%;
}

/* =========================================================
   BASIC SCREEN SYSTEM
========================================================= */

.screen{
  position:relative;
  display:grid;
  grid-template-rows:
    96px
    minmax(300px,1fr)
    270px;
  overflow:hidden;
  opacity:0;
  transform:translateY(24px);
  transition:
    opacity .28s cubic-bezier(.2,.8,.2,1),
    transform .28s cubic-bezier(.2,.8,.2,1);
}

.screen-visible{
  opacity:1;
  transform:none;
}

.scene-art{
  position:absolute;
  inset:0;
  z-index:0;

  background-image:url('/assets/attic.png');
  background-size:cover;
  background-position:center 45%;
}

/*
 * Пока у нас только арт чердака.
 * Цветом лишь слегка различаем заглушки комнат.
 */
.room-library .scene-art{
  filter:hue-rotate(-15deg) saturate(.85);
}

.room-kitchen .scene-art{
  filter:hue-rotate(18deg) saturate(.82) brightness(1.08);
}

.room-basement .scene-art{
  filter:hue-rotate(42deg) saturate(.72) brightness(.7);
}

.scrim-top,
.scrim-bottom{
  position:absolute;
  left:0;
  right:0;
  z-index:1;
  pointer-events:none;
}

.scrim-top{
  top:0;
  height:170px;
  background:
    linear-gradient(
      180deg,
      rgba(8,9,18,.91) 0%,
      rgba(8,9,18,.54) 55%,
      transparent 100%
    );
}

.scrim-bottom{
  bottom:0;
  height:330px;
  background:
    linear-gradient(
      0deg,
      rgba(8,9,18,.98) 0%,
      rgba(8,9,18,.85) 48%,
      transparent 100%
    );
}

.screen-head,
.screen-stage,
.screen-dock{
  position:relative;
  z-index:3;
}

.screen-head{
  padding:
    max(20px,env(safe-area-inset-top))
    var(--pad)
    0;

  display:flex;
  align-items:flex-start;
  justify-content:center;
}

.screen-head h1,
.screen-head h2,
.screen-head h3{
  margin:0;
  text-align:center;
  text-shadow:0 3px 18px rgba(0,0,0,.9);
}

.screen-head h1{
  font-size:34px;
  line-height:1.2;
  font-weight:750;
}

.screen-head h2{
  font-size:26px;
  line-height:1.25;
  font-weight:700;
}

.screen-stage{
  padding:0 var(--pad);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-height:0;
}

.screen-dock{
  padding:
    16px
    var(--pad)
    max(20px,env(safe-area-inset-bottom));

  display:flex;
  flex-direction:column;
  justify-content:flex-end;
}

.timer-line{
  position:absolute;
  left:0;
  top:0;
  right:0;
  height:4px;
  z-index:20;
  background:rgba(255,255,255,.08);
}

.timer-line i{
  display:block;
  height:100%;
  width:72%;
  background:var(--amber);
  animation:timerFake 25s linear forwards;
}

@keyframes timerFake{
  from{width:100%}
  to{width:0}
}

/* =========================================================
   CTA
========================================================= */

.cta{
  width:100%;
  height:68px;
  flex:none;

  border:0;
  border-radius:var(--radius-btn);

  background:
    linear-gradient(180deg,#ffb33a 0%,var(--amber) 45%,var(--amber2) 100%);

  color:#171109;
  font-size:22px;
  font-weight:750;

  box-shadow:
    0 13px 32px rgba(239,159,39,.23);

  cursor:pointer;

  animation:
    ctaIn .2s ease-out .15s both;
}

.cta.secondary{
  height:60px;
  margin-top:12px;

  background:rgba(12,14,23,.48);
  border:1.5px solid rgba(255,255,255,.27);

  color:var(--white);
  box-shadow:none;

  font-size:20px;
  font-weight:600;
}

@keyframes ctaIn{
  from{
    opacity:0;
    transform:translateY(8px);
  }
  to{
    opacity:1;
    transform:none;
  }
}

.dock-copy,
.dock-question{
  margin:0 0 24px;
  text-align:center;
  color:var(--white);
  font-size:18px;
  line-height:1.4;
}

.dock-question{
  font-weight:650;
  font-size:20px;
}

.under-cta{
  margin:8px 0 0;
  text-align:center;
  color:var(--muted);
  font-size:15px;
}

/* =========================================================
   AVATARS
========================================================= */

.person{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:5px;
}

.person strong{
  font-size:15px;
  line-height:1.2;
}

.person small{
  margin-top:-4px;
  color:rgba(255,255,255,.42);
  font-size:13px;
  font-weight:700;
}

.portrait{
  position:relative;
  width:100%;
  aspect-ratio:1;
  border-radius:50%;

  background:#171b2a;
  border:3px solid rgba(255,255,255,.28);

  overflow:visible;

  box-shadow:
    0 12px 32px rgba(0,0,0,.5);
}

.portrait-base{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:50%;
}

.person-micro{
  width:56px;
}

.person-grid{
  width:96px;
}

.person-select{
  width:112px;
}

.person-hero{
  width:140px;
}

.person-selectable{
  cursor:pointer;
}

.person.selected .portrait{
  border-color:var(--amber);
  box-shadow:
    0 0 0 4px rgba(239,159,39,.18),
    0 13px 35px rgba(0,0,0,.55);
  transform:scale(1.08);
}

.trait{
  position:absolute;
  object-fit:contain;
  pointer-events:none;
}

.trait-cap{
  width:77%;
  left:11%;
  top:-10%;
  z-index:6;
}

.trait-glasses{
  width:72%;
  left:14%;
  top:31%;
  z-index:7;
}

.trait-backpack{
  width:86%;
  left:7%;
  top:52%;
  z-index:2;
}

.trait-scarf{
  width:84%;
  left:8%;
  top:64%;
  z-index:8;
}

/* =========================================================
   ROLE
========================================================= */

.role-hero{
  display:flex;
  justify-content:center;
}

.trait-line{
  margin-top:28px;
  display:flex;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
}

.trait-line span{
  min-height:44px;
  padding:0 14px;

  display:flex;
  align-items:center;

  background:rgba(8,10,18,.54);
  border-radius:12px;

  font-size:18px;
  font-weight:650;

  backdrop-filter:blur(10px);
}

.monster-secret{
  margin-top:26px;
  text-align:center;
}

.monster-secret span{
  display:block;
  color:var(--muted);
  font-size:15px;
}

.monster-secret strong{
  display:block;
  margin-top:5px;
  font-size:26px;
}

.monster-reveal{
  display:block;
  background:#000;
  cursor:pointer;
}

.monster-black{
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 50% 48%,#170c22 0%,#000 65%);
}

.monster-full{
  position:absolute;
  width:112%;
  height:82%;
  left:-6%;
  bottom:6%;

  object-fit:contain;

  filter:
    drop-shadow(0 30px 50px #000);

  animation:monsterReveal .8s ease-out both;
}

@keyframes monsterReveal{
  from{
    opacity:0;
    transform:scale(1.1);
  }
  to{
    opacity:1;
    transform:scale(1);
  }
}

.monster-reveal-copy{
  position:absolute;
  z-index:4;
  left:0;
  right:0;
  bottom:58px;
  text-align:center;
}

.monster-reveal-copy h1{
  margin:0;
  font-size:34px;
}

.monster-reveal-copy span{
  display:block;
  margin-top:8px;
  color:rgba(255,255,255,.6);
  font-size:15px;
}

/* =========================================================
   ROOM
========================================================= */

.room-people{
  width:100%;
  min-height:90px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
}

.nobody{
  color:rgba(255,255,255,.65);
  font-size:18px;
}

.back{
  position:absolute;
  left:20px;
  top:12px;

  width:56px;
  height:56px;

  border:0;
  border-radius:50%;

  background:rgba(0,0,0,.28);
  color:#fff;

  font-size:40px;
  line-height:1;
}

.room-cards{
  width:100%;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.room-card{
  position:relative;
  width:100%;
  height:120px;
  flex:none;

  padding:0;
  overflow:hidden;

  border:0;
  border-radius:24px;

  color:#fff;
  text-align:left;

  background:#171925;

  box-shadow:0 13px 26px rgba(0,0,0,.38);
}

.room-card-art{
  position:absolute;
  inset:0;

  background-image:url('/assets/attic.png');
  background-size:cover;
  background-position:center 46%;
}

.room-card-shade{
  position:absolute;
  inset:0;
  background:
    linear-gradient(
      90deg,
      rgba(6,8,15,.9),
      rgba(6,8,15,.25) 70%
    );
}

.room-card strong{
  position:absolute;
  left:18px;
  bottom:17px;

  font-size:22px;
  font-weight:700;
}

.room-card-faces{
  position:absolute;
  right:15px;
  bottom:13px;

  display:flex;
}

.mini-face{
  width:40px;
  height:40px;

  margin-left:-8px;

  border:2px solid rgba(255,255,255,.82);
  border-radius:50%;

  overflow:hidden;
  background:#171a27;
}

.mini-face img{
  width:100%;
  height:100%;
  object-fit:cover;
}

/* =========================================================
   SEARCH
========================================================= */

.weakness-find{
  text-align:center;
}

.weakness-big{
  font-size:140px;
  line-height:1;
  filter:drop-shadow(0 14px 25px rgba(0,0,0,.55));
}

.weakness-find strong{
  display:block;
  margin-top:16px;
  font-size:26px;
}

.clue-copy{
  font-size:18px;
}

/* =========================================================
   NIGHT / COURAGE
========================================================= */

.courage{
  display:flex;
  justify-content:center;
}

.courage.small{
  position:absolute;
  left:20px;
  top:24px;
  gap:6px;
}

.courage.small i{
  width:20px;
  height:20px;
}

.courage.large{
  gap:16px;
}

.courage.large i{
  width:44px;
  height:44px;
}

.courage i{
  display:block;
  border-radius:50%;

  transition:
    opacity .6s ease-in,
    transform .6s ease-in,
    filter .6s ease-in;
}

.courage .on{
  background:
    radial-gradient(circle at 45% 38%,#ffe28d 0%,#ffac28 42%,#cf6d08 100%);
  box-shadow:
    0 0 22px rgba(239,159,39,.56);
}

.courage .off{
  background:#353641;
  opacity:.3;
  filter:grayscale(1);
}

.night-screen .scene-art{
  filter:brightness(.46) saturate(.72) hue-rotate(6deg);
}

.night-center{
  text-align:center;
  text-shadow:0 4px 20px #000;
}

.night-center span{
  display:block;
  font-size:26px;
  font-weight:700;
}

.night-center strong{
  display:block;
  margin-top:8px;

  color:rgba(255,255,255,.76);
  font-size:18px;
  font-weight:500;
}

/* =========================================================
   MONSTER HUNT
========================================================= */

.monster-hunt .scene-art{
  filter:
    brightness(.42)
    saturate(.72)
    sepia(.12)
    hue-rotate(310deg);
}

.monster-room-card{
  width:100%;
  height:340px;

  padding:20px 12px;

  display:flex;
  flex-direction:column;

  border-radius:28px;

  background:rgba(45,8,16,.38);
  box-shadow:
    inset 0 0 0 1px rgba(255,80,90,.22),
    0 18px 44px rgba(0,0,0,.38);

  backdrop-filter:blur(3px);
  touch-action:pan-y;
}

.monster-room-name{
  text-align:center;
  color:#ff9298;
  font-size:22px;
  font-weight:700;
}

.monster-victims{
  flex:1;

  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
}

.victim-pick{
  width:112px;
  min-height:160px;

  padding:0;
  border:0;
  background:none;

  color:#fff;
}

.monster-empty{
  font-size:26px;
  opacity:.5;
}

.room-dots{
  display:flex;
  justify-content:center;
  gap:8px;
  margin-top:14px;
}

.room-dots i{
  width:8px;
  height:8px;

  border-radius:99px;
  background:rgba(255,255,255,.27);
}

.room-dots i.on{
  width:22px;
  background:#ef747d;
}

.monster-tools{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:14px;
}

.monster-tools button{
  min-height:52px;

  border:1px solid rgba(255,96,108,.27);
  border-radius:16px;

  background:rgba(57,10,18,.52);
  color:#ff959d;

  font-size:22px;
}

.monster-tools span{
  display:block;
  font-size:15px;
  font-weight:600;
}

.hold-progress{
  width:100%;
  height:6px;
  margin-top:8px;

  overflow:hidden;

  border-radius:99px;
  background:rgba(255,255,255,.13);
}

.hold-progress i{
  display:block;
  width:0;
  height:100%;

  background:#fff2c7;

  transition:width .03s linear;
}

/* =========================================================
   DAWN
========================================================= */

.dawn-screen .screen-stage{
  justify-content:center;
}

.dawn-candles{
  display:flex;
  justify-content:center;
}

.dawn-event{
  margin-top:38px;
  text-align:center;
}

.dawn-event strong{
  font-size:22px;
}

/* =========================================================
   EVIDENCE
========================================================= */

.evidence-screen{
  background:#0c0d15;
}

.evidence-screen .scene-art{
  opacity:.18;
  filter:blur(4px);
}

.deck-progress{
  width:100%;
  display:flex;
  justify-content:center;
  gap:8px;
  padding-top:12px;
}

.deck-progress i{
  width:42px;
  height:4px;

  border-radius:99px;
  background:rgba(255,255,255,.17);
}

.deck-progress i.on{
  background:var(--amber);
}

.evidence-card{
  width:350px;
  height:420px;
  max-width:100%;

  padding:24px;

  display:flex;
  flex-direction:column;
  align-items:center;

  border-radius:28px;

  background:
    linear-gradient(
      180deg,
      rgba(37,38,49,.96),
      rgba(23,24,33,.96)
    );

  box-shadow:
    0 25px 55px rgba(0,0,0,.46);
}

.evidence-author{
  height:156px;
}

.evidence-card h3{
  margin:2px 0 18px;

  font-size:22px;
  font-weight:650;
}

.claim-icon{
  font-size:96px;
  line-height:1.1;
}

.claim-label{
  margin-top:10px;
  font-size:19px;
}

.belief-buttons{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.believe{
  height:66px;

  border-radius:18px;

  font-size:20px;
  font-weight:700;
}

.believe.yes{
  border:0;
  background:var(--green);
  color:#fff;
}

.believe.no{
  border:1.5px solid rgba(255,90,105,.5);
  background:rgba(35,15,21,.65);
  color:#ff858f;
}

/* =========================================================
   NOTEBOOK
========================================================= */

.suspect-grid{
  width:100%;

  display:grid;
  grid-template-columns:repeat(3,96px);
  justify-content:center;

  column-gap:20px;
  row-gap:24px;
}

.suspect-grid > div{
  transition:
    opacity .4s ease-out,
    filter .4s ease-out,
    transform .4s ease-out;
}

.suspect-grid .excluded{
  opacity:.25;
  filter:grayscale(1);
  transform:scale(.92);
}

/* =========================================================
   FINAL
========================================================= */

.final-people{
  width:100%;

  display:grid;
  grid-template-columns:repeat(3,96px);
  justify-content:center;

  gap:24px 20px;
}

.final-people button{
  width:96px;
  padding:0;

  border:0;
  background:none;
  color:#fff;
}

.final-people button:not(.selected){
  opacity:.72;
}

.weakness-list{
  width:100%;

  display:flex;
  flex-direction:column;
  gap:18px;
}

.weakness-list button{
  width:100%;
  min-height:145px;

  padding:10px 20px;

  display:flex;
  align-items:center;
  gap:24px;

  border:2px solid rgba(255,255,255,.12);
  border-radius:26px;

  background:rgba(13,15,24,.64);
  color:#fff;

  text-align:left;
}

.weakness-list button.selected{
  border-color:var(--amber);
  background:rgba(239,159,39,.1);
}

.weakness-list span{
  width:140px;

  text-align:center;
  font-size:100px;
  line-height:1;
}

.weakness-list strong{
  font-size:24px;
}

/* =========================================================
   GAME OVER
========================================================= */

.ending-monster{
  width:100%;
  height:310px;
  display:grid;
  place-items:center;
}

.ending-monster img{
  max-width:108%;
  max-height:100%;
  object-fit:contain;

  filter:drop-shadow(0 20px 35px rgba(0,0,0,.6));
}

.ending-truth{
  text-align:center;
}

.ending-truth strong{
  display:block;
  font-size:26px;
}

.ending-truth span{
  display:block;
  margin-top:7px;
  font-size:18px;
  color:var(--muted);
}

/* =========================================================
   DEV OUTSIDE DEVICE
========================================================= */

.dev-tools{
  position:fixed;
  left:20px;
  bottom:20px;

  display:flex;
  align-items:center;
  gap:8px;

  padding:9px 12px;

  border-radius:14px;

  background:rgba(10,12,19,.8);
  border:1px solid rgba(255,255,255,.08);

  color:#777e8d;

  font-size:13px;
}

.dev-tools button{
  min-height:36px;
  padding:0 11px;

  border:1px solid rgba(255,255,255,.1);
  border-radius:9px;

  background:#171a24;
  color:#c2c6cf;
}

.dev-tools span{
  opacity:.5;
}

/* =========================================================
   MOBILE
========================================================= */

@media(max-width:599px){

  :root{
    --pad:20px;
  }

  body{
    overflow:hidden;
  }

  .desktop-stage{
    display:block;
    width:100vw;
    height:100svh;
  }

  .device{
    width:100vw;
    height:100svh;

    transform:none !important;

    box-shadow:none;
  }

  .screen{
    grid-template-rows:
      96px
      minmax(300px,1fr)
      min(270px,32svh);
  }

  .dev-tools{
    display:none;
  }

}

@media(max-width:375px){

  :root{
    --pad:16px;
  }

  .screen{
    grid-template-rows:
      92px
      minmax(300px,1fr)
      min(245px,31svh);
  }

  .dock-copy{
    margin-bottom:18px;
  }

  .evidence-card{
    width:100%;
  }

}

/* Reduced motion */
@media(prefers-reduced-motion:reduce){

  *,
  *::before,
  *::after{
    animation-duration:.15s !important;
    animation-delay:0s !important;
    transition-duration:.15s !important;
  }

}
