﻿:root {
  --bg: #050505;
  --panel: #0d0d14;
  --wall: #f7ff14;
  --wall-glow: rgba(247, 255, 20, 0.5);
  --dot: #f4f4f4;
  --text: #ffffff;
  --muted: #c7c7d3;
  --yellow: #f7ff14;
  --danger: #ff5c73;
  --good: #79ff9c;
  --tile: 28px;
  --board-bg: #030303;
  --shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: #efefef;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 16px;
}

.game-shell {
  width: min(100%, 760px);
  background: var(--bg);
  border: 4px solid #dcdcdc;
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px 10px;
  background: #000;
}

.hud-center {
  text-align: center;
}

.hud-right {
  text-align: right;
}

.label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
}

.target-word {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  word-break: break-word;
}

.board-wrap {
  position: relative;
  padding: 8px 12px;
  background: #000;
  touch-action: none;
  user-select: none;
}

.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(19, var(--tile));
  grid-template-rows: repeat(21, var(--tile));
  justify-content: center;
  align-content: center;
  background: var(--board-bg);
  margin: 0 auto;
  outline: 2px solid #dcdcdc;
  outline-offset: 0;
}

.tile {
  width: var(--tile);
  height: var(--tile);
  position: relative;
}

.wall::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 3px solid var(--wall);
  border-radius: 10px;
  box-shadow: 0 0 8px var(--wall-glow), inset 0 0 8px rgba(0, 0, 0, 0.2);
}

.actor,
.item {
  position: absolute;
  width: calc(var(--tile) - 4px);
  height: calc(var(--tile) - 4px);
  left: 2px;
  top: 2px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.actor.player {
  z-index: 5;
}

.actor.player img {
  width: 86%;
  height: 86%;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.65));
}

.actor.ghost {
  width: calc(var(--tile) - 6px);
  height: calc(var(--tile) - 6px);
  left: 3px;
  top: 3px;
  border-radius: 9px 9px 5px 5px;
}

.actor.ghost::before,
.actor.ghost::after {
  content: "";
  position: absolute;
  background: #fff;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  top: 8px;
}

.actor.ghost::before {
  left: 6px;
}

.actor.ghost::after {
  right: 6px;
}

.ghost-red {
  background: #ff4d4d;
}

.ghost-pink {
  background: #ff9ac9;
}

.ghost-cyan {
  background: #7de9ff;
}

.ghost-orange {
  background: #ffb347;
}

.item {
  font-size: 22px;
  font-weight: 700;
  padding: 2px;
  text-align: center;
  line-height: 1;
}

.item.target {
  color: var(--yellow);
  text-shadow: 0 0 8px rgba(247, 255, 20, 0.35);
  font-size: 16px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.item.target.emoji {
  font-size: 22px;
}

.item.decoy {
  filter: saturate(1.15);
}

.footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 16px;
  background: #000;
  border-top: 2px solid #1d1d1d;
  border-bottom: 2px solid #dcdcdc;
}

.footer-label {
  color: var(--muted);
  margin-right: 8px;
}

.lives-wrap,
.status-wrap {
  display: flex;
  align-items: center;
}

.lives {
  display: flex;
  gap: 8px;
  align-items: center;
}

.life-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.hidden {
  display: none;
}

.overlay-card {
  width: min(90%, 420px);
  background: #11131a;
  border: 2px solid #2a2f44;
  border-radius: 18px;
  padding: 22px 20px;
  text-align: center;
}

.overlay-card h2 {
  margin: 0 0 8px;
  font-size: 30px;
}

.overlay-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.overlay-card button {
  appearance: none;
  border: 0;
  background: var(--yellow);
  color: #000;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 999px;
  cursor: pointer;
}

@media (max-width: 700px) {
  :root {
    --tile: clamp(18px, 4.7vw, 23px);
  }

  body {
    padding: 8px;
  }

  .hud {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hud-right,
  .hud-center {
    text-align: center;
  }

  .value,
  .target-word {
    font-size: 21px;
  }

  .footer-bar {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .item.target {
    font-size: 13px;
  }

  .item.target.emoji,
  .item.decoy {
    font-size: 19px;
  }
}




