:root {
  color-scheme: dark;
  --felt: #303716;
  --felt-dark: #151a0b;
  --wood: #4b2b17;
  --wood-dark: #160c07;
  --wood-light: #7a4a25;
  --card: #342014;
  --card-deep: #1b100a;
  --card-edge: #8e5b2d;
  --text: #f0d3a1;
  --muted: #aa8a61;
  --line: #78502d;
  --green: #46521c;
  --red: #762d20;
  --blue: #4d594c;
  --gold: #c69755;
  --phase-bg: url("/images/background_night.png");
  --player-bg: url("/images/background_night.png");
  font-family: "Lato", Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255, 202, 122, 0.16), transparent 58%),
    linear-gradient(90deg, rgba(255,255,255,0.07) 0 2px, transparent 2px 74px),
    linear-gradient(180deg, rgba(255,255,255,0.09), rgba(0,0,0,0.2)),
    repeating-linear-gradient(90deg, #6a3718 0 46px, #845024 46px 94px, #5a2d13 94px 138px);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.host-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(330px, 420px) 1fr;
  gap: 26px;
  padding: 26px;
  background:
    radial-gradient(ellipse at center, rgba(54, 104, 70, 0.9), rgba(13, 42, 28, 0.96) 72%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.035) 0 3px, transparent 3px 13px);
  box-shadow: inset 0 0 0 12px rgba(51, 25, 9, 0.55), inset 0 0 70px rgba(0,0,0,0.45);
}

body[data-phase="dayResult"] .host-shell,
body[data-phase="discussion"] .host-shell,
body[data-phase="vote"] .host-shell,
body[data-phase="trialResult"] .host-shell,
body[data-phase="ended"] .host-shell {
  background:
    linear-gradient(180deg, rgba(255, 236, 182, 0.32), rgba(71, 46, 19, 0.16)),
    radial-gradient(ellipse at center, rgba(245, 197, 109, 0.38), rgba(77, 112, 65, 0.4) 72%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 3px, transparent 3px 13px);
}

.side,
.main,
.player-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.38), transparent 28%),
    radial-gradient(ellipse at top, #fff3d1, transparent 58%),
    linear-gradient(180deg, var(--card), var(--card-deep));
  border: 6px solid var(--card-edge);
  border-radius: 8px;
  box-shadow:
    inset 0 4px 0 rgba(255,255,255,0.62),
    inset 0 -8px 0 rgba(96,48,19,0.18),
    0 9px 0 rgba(48,24,10,0.85),
    0 22px 34px rgba(0,0,0,0.34);
}

.side {
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), transparent 34%),
    repeating-linear-gradient(90deg, #b16c33 0 34px, #8f5225 34px 74px, #c17a3a 74px 116px);
  position: relative;
  overflow: hidden;
}

.side::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px solid rgba(255, 235, 173, 0.22);
  border-radius: 6px;
  pointer-events: none;
}

.side::after {
  content: "";
  position: absolute;
  inset: auto 18px 18px;
  height: 42px;
  border-radius: 50%;
  background: rgba(49, 24, 8, 0.22);
  filter: blur(12px);
  pointer-events: none;
}

.side > * {
  position: relative;
  z-index: 1;
}

.main {
  display: grid;
  align-content: center;
  justify-items: center;
  padding: clamp(28px, 4vw, 54px);
  min-height: calc(100vh - 52px);
  background:
    linear-gradient(180deg, rgba(15, 10, 6, 0.25), rgba(0,0,0,0.48)),
    radial-gradient(ellipse at 50% 22%, rgba(255, 238, 188, 0.24), transparent 62%),
    var(--phase-bg) center / cover no-repeat,
    linear-gradient(180deg, #f2d18f, #c7853d);
  position: relative;
  overflow: hidden;
}

.main::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 3px solid rgba(86, 48, 22, 0.34);
  border-radius: 6px;
  pointer-events: none;
}

.main::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 42%, rgba(0,0,0,0.38)),
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(0,0,0,0.18));
  pointer-events: none;
}

.main > * {
  position: relative;
  z-index: 1;
}

.qr {
  width: min(100%, 286px);
  aspect-ratio: 1;
  display: block;
  margin: 2px auto 14px;
  padding: 10px;
  background: #fff9ed;
  border: 3px solid #4d2a12;
  border-radius: 8px;
  box-shadow: inset 0 0 0 4px #ead3a5, 0 5px 0 rgba(48, 24, 10, 0.55);
}

.join-code {
  font-size: clamp(48px, 6vw, 78px);
  font-weight: 900;
  text-align: center;
  letter-spacing: 0;
  color: #fff3c3;
  text-shadow: 0 3px 0 #3d220e;
  background: rgba(48, 24, 10, 0.34);
  border: 3px solid rgba(255, 232, 164, 0.26);
  border-radius: 8px;
  padding: 6px 8px 9px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.22);
}

.host-label {
  color: #fff0c0;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  margin: 10px 0 14px;
  text-shadow: 0 2px 0 #3d220e;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tv-link {
  display: block;
  margin: -4px 0 10px;
  color: #fff3c3;
  text-align: center;
  font-weight: 900;
  text-decoration: none;
  text-shadow: 0 2px 0 #3d220e;
}

.tv-audio-button {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 3px solid rgba(255, 232, 166, 0.42);
  border-radius: 8px;
  padding: 12px 16px;
  background: rgba(42, 22, 8, 0.82);
  color: #fff3c3;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.25), 0 5px 0 rgba(47, 24, 8, 0.55);
  font-family: "Lato", Arial, sans-serif;
  font-size: 18px;
  font-weight: 900;
  text-shadow: 0 2px 0 #3d220e;
}

.phase-icon {
  font-size: clamp(24px, 4vw, 54px);
  min-width: clamp(140px, 18vw, 250px);
  min-height: clamp(82px, 10vw, 130px);
  padding: 0 22px;
  display: grid;
  place-items: center;
  color: #fff3d2;
  background: rgba(43, 22, 8, 0.42);
  border: 5px solid rgba(255, 230, 160, 0.38);
  border-radius: 12px;
  box-shadow: inset 0 4px 0 rgba(255,255,255,0.45), 0 7px 0 rgba(77, 40, 15, 0.35);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.phase-title {
  font-size: clamp(52px, 8vw, 104px);
  font-weight: 900;
  text-align: center;
  color: #fff1c8;
  text-shadow: 0 4px 0 rgba(47, 24, 8, 0.72), 0 0 18px rgba(0,0,0,0.3);
  margin-top: 14px;
}

.timer {
  font-size: clamp(82px, 13vw, 178px);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin: 22px 0 18px;
  color: #fff0c7;
  text-shadow: 0 4px 0 rgba(40, 20, 8, 0.76), 0 0 20px rgba(0,0,0,0.3);
  background: rgba(42, 22, 8, 0.42);
  border: 5px solid rgba(255, 232, 166, 0.32);
  border-radius: 8px;
  padding: 4px 28px 14px;
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.35), 0 6px 0 rgba(77, 40, 15, 0.25);
}

.status {
  font-size: clamp(24px, 3vw, 42px);
  color: #ffeec2;
  text-align: center;
  font-weight: 800;
  text-shadow: 0 3px 0 rgba(47, 24, 8, 0.72);
}

.tv-shell {
  min-height: 100vh;
  padding: 26px;
  background:
    radial-gradient(ellipse at center, rgba(54, 104, 70, 0.9), rgba(13, 42, 28, 0.96) 72%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.035) 0 3px, transparent 3px 13px);
}

.tv-main {
  min-height: calc(100vh - 52px);
}

.tv-counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  color: #fff0c7;
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 900;
  text-shadow: 0 3px 0 rgba(47, 24, 8, 0.72);
}

.tv-join {
  display: grid;
  grid-template-columns: auto minmax(220px, 380px);
  align-items: center;
  gap: clamp(16px, 3vw, 34px);
  margin: 8px 0 18px;
}

.tv-qr {
  width: clamp(130px, 16vw, 210px);
  aspect-ratio: 1;
  display: block;
  padding: 8px;
  background: #fff9ed;
  border: 4px solid rgba(255, 232, 166, 0.72);
  border-radius: 8px;
  box-shadow: inset 0 0 0 4px #ead3a5, 0 6px 0 rgba(48, 24, 10, 0.55);
}

.tv-counts strong {
  font-size: 1.4em;
}

.tv-players {
  width: min(100%, 980px);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.tv-player {
  border: 3px solid rgba(255, 232, 166, 0.32);
  border-radius: 8px;
  background: rgba(42, 22, 8, 0.42);
  color: #fff0c7;
  padding: 8px 16px 10px;
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 900;
  text-shadow: 0 2px 0 rgba(40, 20, 8, 0.76);
}

.tv-player.dead {
  opacity: 0.56;
  text-decoration: line-through;
}

.tv-player.spectator {
  opacity: 0.72;
}

.manage-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255, 202, 122, 0.16), transparent 58%),
    repeating-linear-gradient(90deg, #6a3718 0 46px, #845024 46px 94px, #5a2d13 94px 138px);
}

.manage-panel {
  width: min(100%, 760px);
  display: grid;
  gap: 16px;
  padding: clamp(22px, 5vw, 34px);
  border: 6px solid var(--card-edge);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.38), transparent 28%),
    linear-gradient(180deg, var(--card), var(--card-deep));
  box-shadow:
    inset 0 4px 0 rgba(255,255,255,0.62),
    0 9px 0 rgba(48,24,10,0.85),
    0 22px 34px rgba(0,0,0,0.34);
}

.game-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.lan-box {
  display: grid;
  gap: 4px;
  border: 4px solid #6d3d1b;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.42), transparent 45%),
    #fff3d0;
  padding: 14px;
  text-align: center;
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.5), 0 4px 0 #553014;
}

.lan-box strong {
  font-size: 18px;
  color: #6b3d18;
  text-transform: uppercase;
}

.lan-box span {
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 900;
  color: #351d0d;
}

.lan-box small {
  font-size: 18px;
  font-weight: 900;
  color: #8b2818;
}

.game-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 4px solid #6d3d1b;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.42), transparent 45%),
    #fff3d0;
  padding: 14px;
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.5), 0 4px 0 #553014;
}

.game-code {
  font-size: clamp(34px, 8vw, 54px);
  font-weight: 900;
  line-height: 1;
}

.game-phase,
.game-counts {
  color: #6b3d18;
  font-size: 18px;
  font-weight: 900;
}

.game-counts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.game-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.game-actions .button {
  margin-top: 0;
  text-decoration: none;
}

.empty-games {
  border: 4px dashed #6d3d1b;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  color: #6b3d18;
}

.counts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.count {
  border: 3px solid #5d3418;
  border-radius: 8px;
  padding: 10px 12px 12px;
  text-align: center;
  font-size: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.32), transparent 50%),
    #f0c982;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.45);
  font-weight: 800;
}

.count strong {
  display: block;
  font-size: 38px;
  line-height: 1;
  margin-bottom: 3px;
}

.button {
  width: 100%;
  min-height: 58px;
  border: 3px solid #4a2811;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.3), transparent 45%),
    linear-gradient(180deg, #925522, #693715);
  color: #fff6d6;
  font-size: 22px;
  font-weight: 800;
  margin-top: 10px;
  cursor: pointer;
  text-shadow: 0 2px 0 #3c1f0c;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.35), 0 5px 0 #351b0a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 80ms ease, box-shadow 80ms ease, filter 80ms ease;
}

.button:hover {
  filter: brightness(1.04);
}

.button:active {
  transform: translateY(4px);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.22), 0 1px 0 #351b0a;
  filter: brightness(0.96);
}

.button.secondary {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.32), transparent 45%),
    linear-gradient(180deg, #d9a74e, #a96b23);
  color: #fff8df;
  border: 3px solid #5a3517;
}

.button.secondary:nth-of-type(3),
.button.secondary:nth-of-type(4) {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.34), transparent 45%),
    linear-gradient(180deg, #c8913d, #855019);
}

.button.green {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.28), transparent 45%),
    linear-gradient(180deg, #4d9a41, #2f6828);
}

#newGame {
  min-height: 72px;
  font-size: 26px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.32), transparent 45%),
    linear-gradient(180deg, #5fb04e, #2e6d27);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.4), 0 6px 0 #1e461a, 0 14px 22px rgba(0,0,0,0.26);
}

.button.red {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.24), transparent 45%),
    linear-gradient(180deg, #b94d35, #862917);
}

.players {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  max-height: 28vh;
  overflow: auto;
  padding-right: 4px;
}

.players::-webkit-scrollbar {
  width: 10px;
}

.players::-webkit-scrollbar-track {
  background: rgba(57, 29, 11, 0.22);
  border-radius: 8px;
}

.players::-webkit-scrollbar-thumb {
  background: #d8a050;
  border: 2px solid #5b3216;
  border-radius: 8px;
}

.player-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
  position: relative;
  border: 2px solid rgba(62, 31, 12, 0.26);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 19px;
  color: #fff1c7;
  text-shadow: 0 2px 0 #3d220e;
  background: rgba(54, 28, 11, 0.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.player-row.dead {
  color: var(--muted);
  text-decoration: line-through;
}

.player-row.offline {
  opacity: 0.72;
}

.row-status {
  font-size: 13px;
  color: #ffe3a2;
  text-transform: uppercase;
  font-weight: 900;
}

.player-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  background: rgba(50, 25, 9, 0.48);
  border: 2px solid rgba(255, 231, 170, 0.36);
  border-radius: 8px;
  padding: 7px;
}

.player-actions button {
  min-height: 38px;
  border: 2px solid #f0c982;
  border-radius: 6px;
  background: #7b441c;
  color: #fff2c8;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.player-actions button.danger {
  border-color: #b86a58;
  background: #6e2b20;
}

.player-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.role-select {
  min-height: 38px;
  border: 2px solid #f0c982;
  border-radius: 6px;
  background: #2a190f;
  color: #ead09d;
  font-size: 13px;
  font-weight: 900;
  padding: 0 8px;
}

.player-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.22), rgba(0,0,0,0.54)),
    var(--player-bg) center / cover no-repeat,
    radial-gradient(ellipse at center, rgba(52, 97, 65, 0.82), rgba(13, 42, 28, 0.92) 72%),
    linear-gradient(90deg, rgba(255,255,255,0.06) 0 2px, transparent 2px 74px),
    repeating-linear-gradient(90deg, #6a3718 0 46px, #845024 46px 94px, #5a2d13 94px 138px);
  box-shadow: inset 0 0 0 10px rgba(51, 25, 9, 0.5), inset 0 0 58px rgba(0,0,0,0.38);
}

.player-card {
  width: min(100%, 540px);
  min-height: min(760px, calc(100vh - 36px));
  display: grid;
  align-content: center;
  gap: 20px;
  padding: clamp(24px, 6vw, 38px);
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.3), transparent 28%),
    radial-gradient(ellipse at top, rgba(255, 243, 209, 0.92), rgba(249, 228, 181, 0.84) 58%),
    linear-gradient(180deg, rgba(249, 228, 181, 0.88), rgba(215, 168, 93, 0.9));
  backdrop-filter: blur(1px);
  position: relative;
}

.player-topbar {
  position: absolute;
  top: 14px;
  inset-inline: 14px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.icon-button {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 3px solid #4a2811;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.3), transparent 45%),
    linear-gradient(180deg, #925522, #693715);
  color: #fff6d6;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.35), 0 4px 0 #351b0a;
  pointer-events: auto;
}

.icon-button.exit {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.24), transparent 45%),
    linear-gradient(180deg, #b94d35, #862917);
}

.mini-icon {
  width: 30px;
  height: 30px;
  filter: brightness(0) invert(1);
}

.connection {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  font-size: 14px;
  font-weight: 900;
  color: #654018;
  text-transform: uppercase;
}

.connection.offline {
  color: #8b2818;
}

.big-word {
  font-size: clamp(74px, 18vw, 138px);
  font-weight: 900;
  color: #351d0d;
  text-shadow: 0 3px 0 rgba(255,255,255,0.45);
}

.instructions-image {
  width: min(100%, 430px);
  max-height: min(56vh, 470px);
  object-fit: contain;
  justify-self: center;
  border: 5px solid rgba(86, 48, 22, 0.72);
  border-radius: 8px;
  background: rgba(255, 246, 222, 0.9);
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,0.45),
    0 6px 0 rgba(77, 40, 15, 0.42),
    0 18px 28px rgba(0,0,0,0.28);
}

.big-icon {
  font-size: clamp(82px, 22vw, 150px);
  line-height: 1;
  min-height: clamp(96px, 22vw, 156px);
  display: grid;
  place-items: center;
  color: #351d0d;
}

.big-title {
  font-size: clamp(42px, 11vw, 78px);
  font-weight: 900;
  color: #351d0d;
  text-shadow: 0 2px 0 rgba(255,255,255,0.45);
}

.one-line {
  font-size: clamp(24px, 7vw, 42px);
  color: #6b3d18;
  font-weight: 800;
}

.form {
  display: grid;
  gap: 16px;
}

.error {
  border: 3px solid #8b2818;
  border-radius: 8px;
  background: #ffe0d5;
  color: #7b1f12;
  font-size: 20px;
  font-weight: 900;
  padding: 10px 12px;
}

.input,
.select {
  width: 100%;
  min-height: 72px;
  border: 4px solid #6d3d1b;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.48), transparent 45%),
    #fff8e8;
  color: var(--text);
  padding: 0 16px;
  font-size: 28px;
  font-weight: 800;
  box-shadow: inset 0 4px 8px rgba(70,35,12,0.18), 0 4px 0 rgba(85,48,20,0.35);
}

.compact-select {
  min-height: 54px;
  font-size: 20px;
  margin-top: 10px;
}

.target-list {
  display: grid;
  gap: 12px;
}

.target {
  min-height: 72px;
  border: 4px solid #6d3d1b;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.38), transparent 45%),
    linear-gradient(180deg, #fff4d7, #e4bd76);
  color: var(--text);
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 4px 0 #553014;
}

.target:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #553014;
}

.target[disabled],
.button[disabled] {
  opacity: 0.62;
  cursor: wait;
}

.photo-pick {
  min-height: 108px;
  border: 4px solid #6d3d1b;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.42), transparent 45%),
    #fff3d0;
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px;
  font-size: 26px;
  font-weight: 900;
  text-align: left;
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.5), 0 4px 0 #553014;
  cursor: pointer;
}

.photo-pick input {
  display: none;
}

.photo-preview,
.avatar {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid rgba(255, 236, 178, 0.72);
  background: rgba(255,255,255,0.25);
}

.photo-preview {
  width: 76px;
  height: 76px;
  border-color: #6d3d1b;
}

.photo-icon {
  width: 62px;
  height: 62px;
}

.default-avatar {
  display: inline-grid;
  place-items: center;
  color: #fff1c7;
}

.exit-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.62);
  z-index: 50;
  padding: 22px;
}

.exit-box {
  width: min(100%, 420px);
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 6px solid var(--card-edge);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.38), transparent 28%),
    linear-gradient(180deg, var(--card), var(--card-deep));
  box-shadow: 0 12px 0 rgba(48,24,10,0.85), 0 24px 34px rgba(0,0,0,0.34);
}

.hold-button {
  position: relative;
  overflow: hidden;
}

.hold-button::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(255, 244, 180, 0.45);
  transition: width 3s linear;
}

.hold-button.charging::before {
  width: 100%;
}

.hold-button.ready {
  cursor: pointer;
  opacity: 1;
}

.hold-button span {
  position: relative;
  z-index: 1;
}

.selected {
  border-color: #2b5e91;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.35), transparent 45%),
    linear-gradient(180deg, #d8ebff, #91b8dc);
}

.install-art {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: end;
}

.install-step {
  display: grid;
  place-items: center;
  height: 120px;
  border: 4px solid #6d3d1b;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.4), transparent 45%),
    #fff5d8;
  font-size: 56px;
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.5), 0 4px 0 #553014;
}

.hidden {
  display: none !important;
}

[dir="rtl"] {
  font-family: "Lato", Tahoma, Arial, Helvetica, sans-serif;
}

.hugeicon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.12em;
  object-fit: contain;
}

.phase-icon .hugeicon,
.big-icon .hugeicon {
  width: 100%;
  height: 100%;
}

.row-icon {
  width: 32px;
  height: 32px;
}

.button-icon {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
}

.player-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 860px) {
  .host-shell {
    grid-template-columns: 1fr;
  }

  .main {
    min-height: 520px;
  }
}

/* Noir wood theme */
html,
body {
  background: #100a06;
}

.manage-shell {
  min-height: 100svh;
  padding: clamp(20px, 5vw, 64px);
  background:
    linear-gradient(90deg, rgba(0,0,0,0.06), rgba(0,0,0,0.22)),
    url("/images/password_screen_background.png") center / cover no-repeat;
}

.manage-panel {
  width: min(100%, 680px);
  gap: 26px;
  padding: clamp(30px, 5vw, 50px);
  border: 3px solid #8a5628;
  outline: 2px solid rgba(34, 17, 9, 0.95);
  outline-offset: -10px;
  background:
    linear-gradient(180deg, rgba(138, 83, 39, 0.12), rgba(0,0,0,0.28)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 9px),
    #2b180e;
  box-shadow:
    inset 0 0 0 5px rgba(94, 52, 25, 0.56),
    inset 0 22px 38px rgba(255, 180, 94, 0.035),
    0 14px 0 rgba(10, 5, 3, 0.72),
    0 28px 54px rgba(0,0,0,0.72);
}

body.manager-open .manage-panel {
  width: min(100%, 820px);
}

.manage-brand {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.manage-title {
  color: #c8934e;
  font-size: clamp(64px, 11vw, 112px);
  font-weight: 900;
  line-height: 0.9;
  text-transform: uppercase;
  text-shadow:
    0 2px 0 #f0c27d,
    0 5px 0 #573015,
    0 9px 16px rgba(0,0,0,0.68);
}

.manage-rule {
  width: min(88%, 500px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.manage-rule span {
  height: 2px;
  background: linear-gradient(90deg, transparent, #a76d32);
}

.manage-rule span:last-child {
  background: linear-gradient(90deg, #a76d32, transparent);
}

.manage-rule i {
  width: 12px;
  height: 12px;
  border: 2px solid #ad7438;
  transform: rotate(45deg);
}

.password-field {
  position: relative;
  display: block;
}

.password-field > img {
  position: absolute;
  z-index: 1;
  left: 22px;
  top: 50%;
  width: 30px;
  height: 30px;
  transform: translateY(-50%);
  opacity: 0.66;
  filter: sepia(1) saturate(0.55) brightness(0.55);
  pointer-events: none;
}

.password-field .input {
  padding-left: 66px;
}

.manage-panel .input,
.manage-panel .select,
.input,
.select {
  border-color: #5b341a;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.24), transparent 52%),
    #ead1a8;
  color: #422a1a;
  box-shadow:
    inset 0 3px 8px rgba(74, 39, 17, 0.22),
    0 0 0 4px #160c07,
    0 4px 0 #744723;
}

.input::placeholder {
  color: #6f543b;
  opacity: 1;
}

.manage-panel .button.green,
.button.green,
#newGame {
  border-color: #171b09;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), transparent 46%),
    linear-gradient(180deg, #4d591f, #2b3512);
  color: #e6c991;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #171006;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.16),
    0 0 0 3px #101006,
    0 6px 0 #0e1206,
    0 14px 24px rgba(0,0,0,0.38);
}

.button,
.button.secondary,
.icon-button,
.tv-audio-button {
  border-color: #5f3c20;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.09), transparent 46%),
    linear-gradient(180deg, #5b3820, #301b10);
  color: #edd29e;
  text-shadow: 0 2px 0 #160c07;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.12), 0 5px 0 #160c07;
}

.button.red,
.icon-button.exit {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.1), transparent 46%),
    linear-gradient(180deg, #79392b, #481d17);
}

.side,
.player-card,
.exit-box {
  border-color: #70451f;
  background:
    linear-gradient(180deg, rgba(170, 105, 52, 0.09), transparent 30%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.015) 0 1px, transparent 1px 10px),
    linear-gradient(180deg, #352014, #1a0f09);
  color: var(--text);
  box-shadow:
    inset 0 0 0 3px rgba(18, 9, 5, 0.75),
    0 8px 0 #100905,
    0 20px 36px rgba(0,0,0,0.5);
}

.host-shell,
.tv-shell {
  background:
    radial-gradient(ellipse at center, rgba(47, 55, 23, 0.75), rgba(10, 12, 7, 0.97) 74%),
    #101008;
  box-shadow: inset 0 0 0 10px rgba(24, 13, 7, 0.78), inset 0 0 80px rgba(0,0,0,0.65);
}

body[data-phase="dayResult"] .host-shell,
body[data-phase="discussion"] .host-shell,
body[data-phase="vote"] .host-shell,
body[data-phase="trialResult"] .host-shell,
body[data-phase="ended"] .host-shell {
  background:
    radial-gradient(ellipse at center, rgba(78, 72, 38, 0.76), rgba(17, 15, 8, 0.96) 76%),
    #171208;
}

.main {
  border-color: #765027;
  box-shadow:
    inset 0 0 0 3px rgba(16, 9, 5, 0.78),
    0 8px 0 #0e0805,
    0 20px 34px rgba(0,0,0,0.52);
}

.phase-icon,
.timer,
.join-code,
.tv-player {
  color: #e7c78d;
  border-color: rgba(182, 126, 62, 0.5);
  background: rgba(24, 13, 8, 0.68);
  text-shadow: 0 3px 0 #110906;
}

.phase-title,
.status,
.host-label,
.tv-counts,
.tv-link {
  color: #e9cc96;
  text-shadow: 0 3px 0 #110906;
}

.count {
  border-color: #65401f;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), transparent 50%),
    #2b1a10;
  color: #e7c78d;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.player-row,
.player-actions {
  border-color: rgba(175, 118, 55, 0.35);
  background: rgba(18, 10, 6, 0.7);
  color: #ecd09a;
}

.row-status {
  color: #c8a76f;
}

.player-actions button {
  border-color: #8d6232;
  background: #3a2214;
  color: #ead09d;
}

.player-shell {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.34), rgba(0,0,0,0.68)),
    var(--player-bg) center / cover no-repeat,
    #111008;
  box-shadow: inset 0 0 0 8px rgba(17, 9, 5, 0.74), inset 0 0 72px rgba(0,0,0,0.62);
}

.big-word,
.big-icon,
.big-title {
  color: #e3c083;
  text-shadow: 0 3px 0 #4e2d15, 0 8px 18px rgba(0,0,0,0.48);
}

.phase-icon .hugeicon,
.big-icon .hugeicon,
.install-step .hugeicon,
.photo-icon,
.default-avatar .hugeicon {
  filter: brightness(0) saturate(100%) invert(78%) sepia(34%) saturate(718%) hue-rotate(356deg) brightness(93%) contrast(91%);
}

.one-line,
.connection {
  color: #c3a375;
}

.photo-pick,
.target,
.install-step,
.instructions-image,
.lan-box,
.game-card,
.empty-games {
  border-color: #67421f;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), transparent 48%),
    #2a190f;
  color: #ecd09a;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.06), 0 4px 0 #120a06;
}

.game-phase,
.game-counts,
.lan-box strong,
.lan-box span,
.lan-box small,
.empty-games,
.photo-pick strong {
  color: #c9a874;
}

.selected {
  border-color: #a88745;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.1), transparent 45%),
    linear-gradient(180deg, #596025, #343b16);
}

.error {
  border-color: #8d4535;
  background: #351813;
  color: #f0b9a4;
}

@media (max-width: 680px) {
  .manage-shell {
    align-items: center;
    background-position: 61% center;
    padding: 16px;
  }

  .manage-panel {
    padding: 28px 22px 32px;
  }

  .manage-title {
    font-size: clamp(58px, 20vw, 86px);
  }
}
