@import url("/games/codenames/styles.css?v=20260326p");

:root {
  --spyfall-red: #d96a5b;
  --spyfall-blue: #5d86df;
  --spyfall-gold: #f0c06e;
  --spyfall-side-width: 228px;
}

.spyfall-shell,
.room-view {
  display: grid;
  gap: 14px;
}

.spyfall-layout {
  display: grid;
  grid-template-columns: var(--spyfall-side-width) minmax(0, 1fr) var(--spyfall-side-width);
  gap: 14px;
  align-items: start;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
}

.topbar > :first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.topbar__line {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start !important;
  gap: 12px;
  min-width: 0;
  width: auto !important;
  max-width: 100%;
}

.topbar__line > * {
  flex: 0 0 auto;
}

.topbar__line h2 {
  margin-right: 6px;
}

.topbar__room-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
  justify-content: flex-start;
  max-width: 100%;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.topbar__actions .icon-chip,
.topbar__actions .ghost-button {
  flex: 0 0 auto;
}

.spyfall-side,
.main-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.spyfall-side {
  padding: 12px;
  align-content: start;
  min-width: 0;
}

.spyfall-side > .spyfall-briefing {
  min-height: 292px;
}

.spyfall-column {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.spyfall-briefing,
.summary-box,
.accusation-box,
.spyfall-player,
.location-board {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel-soft, var(--panel));
}

.spyfall-briefing {
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
  background:
    radial-gradient(circle at top right, rgba(240, 192, 110, 0.13), transparent 28%),
    var(--panel);
}

.spyfall-briefing--compact {
  background:
    radial-gradient(circle at top right, rgba(93, 134, 223, 0.13), transparent 28%),
    var(--panel);
}

.spyfall-briefing--compact[data-finish-kind="players"] {
  border-color: rgba(42, 142, 130, 0.52);
  background:
    radial-gradient(circle at top right, rgba(42, 142, 130, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(42, 142, 130, 0.12), rgba(42, 142, 130, 0.02)),
    var(--panel);
  box-shadow: 0 18px 34px rgba(42, 142, 130, 0.14);
}

.spyfall-briefing--compact[data-finish-kind="spy"] {
  border-color: rgba(217, 106, 91, 0.56);
  background:
    radial-gradient(circle at top right, rgba(217, 106, 91, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(217, 106, 91, 0.12), rgba(217, 106, 91, 0.02)),
    var(--panel);
  box-shadow: 0 18px 34px rgba(217, 106, 91, 0.16);
}

.spyfall-briefing h3 {
  font-size: 1.05rem;
  text-align: center;
  line-height: 1.2;
  overflow-wrap: anywhere;
  min-height: 2.5em;
  display: grid;
  align-items: center;
}

.spyfall-location-preview {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  aspect-ratio: 3 / 2;
  border: 1px solid var(--line);
  background: rgba(11, 16, 26, 0.72);
}

.spyfall-location-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}

.spyfall-briefing p,
.summary-box p,
.accusation-box p {
  color: var(--muted);
  line-height: 1.32;
  font-size: .96rem;
  overflow-wrap: anywhere;
}

.spyfall-briefing--compact {
  justify-content: start;
}

#location-note {
  margin-top: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  text-align: center;
  font-weight: 700;
  color: var(--text);
  background: rgba(42, 142, 130, 0.14);
  border: 1px solid rgba(42, 142, 130, 0.28);
}

.spyfall-briefing--compact #board-status {
  font-size: 1.04rem;
}

.spyfall-briefing--compact[data-finish-kind] #board-status {
  font-size: 1.42rem;
  line-height: 1.15;
  color: var(--text);
  min-height: unset;
}

.spyfall-briefing--compact #board-status-note {
  max-width: none;
  text-align: center;
}

.spyfall-briefing--compact[data-finish-kind] #board-status-note {
  max-width: none;
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
}

.spyfall-briefing--compact[data-finish-kind] {
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 12px;
}

.spyfall-briefing--compact[data-finish-kind] .panel__kicker {
  opacity: 0.95;
}

.spyfall-briefing--compact[data-finish-kind="players"] #board-status {
  color: #dffbf2;
  text-shadow: 0 0 22px rgba(72, 201, 126, 0.18);
}

.spyfall-briefing--compact[data-finish-kind="spy"] #board-status {
  color: #ffe3e0;
  text-shadow: 0 0 22px rgba(239, 86, 86, 0.18);
}

.main-panel {
  padding: 14px;
}

.main-panel__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.main-panel__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.accusation-box,
.location-board {
  padding: 14px;
}
.accusation-box {
  display: grid;
  gap: 8px;
}
.accusation-box strong {
  font-size: 1.16rem;
}
.lobby-actions,
.accusation-box__actions {
  display: flex;
  gap: 12px;
}

.location-board {
  display: grid;
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(11, 16, 26, 0.25), transparent 24%),
    var(--panel);
}

.location-board__label {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.location-board__label p:last-child {
  max-width: 480px;
  text-align: right;
  color: var(--muted);
}

.primary-button--compact {
  width: auto;
  min-width: 0;
  padding-inline: 18px;
  min-height: 48px;
}

.ghost-button--compact {
  width: auto;
  min-width: 0;
  padding-inline: 18px;
  min-height: 48px;
}

.location-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-height: 0;
  align-items: stretch;
}

.location-tile {
  position: relative;
  display: block;
  padding: 6px;
  min-height: 0;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(15, 19, 28, 0.58);
  color: inherit;
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
}

.location-tile:disabled {
  cursor: default;
}

.location-tile__image-wrap {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(12, 18, 27, 0.95), rgba(23, 28, 39, 0.88));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}

.location-tile__result-badge {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(8px);
  z-index: 3;
  pointer-events: none;
}

.location-tile__result-badge--actual {
  background: rgba(36, 161, 91, 0.94);
}

.location-tile__result-badge--spy {
  background: rgba(214, 69, 69, 0.94);
}

.location-tile__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.location-tile__confirm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(240, 192, 110, 0.95), rgba(217, 106, 91, 0.92));
  color: #1a1f29;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 10px 22px rgba(217, 106, 91, 0.26);
  padding: 0;
}

.location-tile__visibility {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(10, 14, 21, 0.74);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
  padding: 0;
}

.location-tile__visibility:hover {
  transform: translateY(-1px);
  background: rgba(18, 24, 36, 0.92);
  border-color: rgba(255, 255, 255, 0.24);
}

.location-tile__visibility:active {
  transform: translateY(0);
}

.location-tile__confirm--overlay {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
}

.location-tile__confirm:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(255, 211, 123, 0.98), rgba(245, 128, 108, 0.96));
  box-shadow: 0 14px 28px rgba(217, 106, 91, 0.34);
}

.location-tile__confirm:active {
  transform: translateY(0);
}

.location-tile__confirm svg {
  width: 18px;
  height: 18px;
}

.location-tile--actual {
  border-color: rgba(42, 142, 130, 0.58);
  box-shadow: 0 0 0 1px rgba(42, 142, 130, 0.18), 0 18px 34px rgba(42, 142, 130, 0.12);
}

.location-tile--actual .location-tile__image-wrap {
  box-shadow:
    inset 0 0 0 1px rgba(42, 142, 130, 0.28),
    0 0 0 2px rgba(42, 142, 130, 0.14);
}

.location-tile--reveal-actual {
  border-color: rgba(72, 201, 126, 0.94);
  box-shadow: 0 0 0 3px rgba(72, 201, 126, 0.42), 0 20px 36px rgba(72, 201, 126, 0.24);
}

.location-tile--reveal-actual .location-tile__image-wrap {
  box-shadow:
    inset 0 0 0 1px rgba(72, 201, 126, 0.48),
    0 0 0 3px rgba(72, 201, 126, 0.22);
}

.location-tile--spy-guess {
  border-color: rgba(239, 86, 86, 0.96);
  box-shadow: 0 0 0 3px rgba(239, 86, 86, 0.34), 0 18px 34px rgba(239, 86, 86, 0.2);
}

.location-tile--spy-guess .location-tile__image-wrap {
  box-shadow:
    inset 0 0 0 1px rgba(239, 86, 86, 0.42),
    0 0 0 3px rgba(239, 86, 86, 0.18);
}

.location-tile--masked {
  opacity: 1;
}

.location-tile--masked .location-tile__image {
  filter: none;
}

.location-tile--guessable {
  cursor: pointer;
}

.location-tile--guessable:hover {
  transform: translateY(-2px);
  border-color: rgba(240, 192, 110, 0.4);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.18);
}

.location-tile--selected {
  border-color: rgba(240, 192, 110, 0.62);
  box-shadow: 0 0 0 1px rgba(240, 192, 110, 0.18), 0 20px 36px rgba(240, 192, 110, 0.14);
}

.location-tile--selected .location-tile__badge {
  background: rgba(240, 192, 110, 0.92);
  color: #1a1f29;
}

.location-tile--concealed .location-tile__image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 14, 21, 0.58), rgba(10, 14, 21, 0.76)),
    radial-gradient(circle at top right, rgba(93, 134, 223, 0.16), transparent 35%);
  pointer-events: none;
}

.location-tile--concealed .location-tile__image {
  filter: blur(8px) saturate(0.8);
  transform: scale(1.06);
  opacity: 0.3;
}

body[data-theme="light"] .location-tile--actual {
  border-color: rgba(42, 142, 130, 0.5);
  box-shadow: 0 0 0 1px rgba(42, 142, 130, 0.14), 0 16px 28px rgba(42, 142, 130, 0.08);
}

body[data-theme="light"] .location-tile--reveal-actual {
  border-color: rgba(43, 158, 91, 0.92);
  box-shadow: 0 0 0 3px rgba(43, 158, 91, 0.26), 0 16px 28px rgba(43, 158, 91, 0.16);
}

body[data-theme="light"] .location-tile--spy-guess {
  border-color: rgba(207, 64, 64, 0.88);
  box-shadow: 0 0 0 3px rgba(207, 64, 64, 0.24), 0 16px 28px rgba(207, 64, 64, 0.14);
}

body[data-theme="light"] .location-tile__visibility {
  background: rgba(255, 249, 241, 0.88);
  color: #334155;
  border-color: rgba(30, 41, 59, 0.12);
}

body[data-theme="light"] .location-tile__visibility:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(30, 41, 59, 0.2);
}

.spyfall-player {
  padding: 12px;
  display: grid;
  gap: 8px;
  border-radius: 20px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.spyfall-player__top,
.player-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.player-card__actions--center {
  justify-content: center;
}

.spyfall-player__identity {
  min-width: 0;
}

.spyfall-player__identity h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .96rem;
  margin: 0;
  min-width: 0;
}

.spyfall-player__identity h4 span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spyfall-player__name-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex: 0 0 auto;
}

.spyfall-player__name-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.spyfall-player__identity p {
  margin: 2px 0 0;
  font-size: .92rem;
  color: var(--muted);
}

.spyfall-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(11, 15, 22, 0.34);
  font-weight: 800;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.spyfall-player__stats {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.spyfall-player__row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(11, 15, 22, 0.26);
}

.spyfall-player__row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--muted);
  flex: 0 0 auto;
}

.spyfall-player__row-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.spyfall-player__row strong {
  text-align: right;
  font-size: .9rem;
}

.spyfall-player__value {
  min-width: 0;
  max-width: 100%;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.spyfall-player--spy {
  border-color: rgba(239, 104, 104, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.02),
    0 0 0 1px rgba(239, 104, 104, 0.14),
    0 18px 36px rgba(239, 104, 104, 0.12);
}

.spyfall-player__value--spy {
  color: #ff7b7b;
}

.spyfall-player .ghost-button {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  box-sizing: border-box;
}

body[data-theme="light"] .spyfall-player--spy {
  border-color: rgba(217, 83, 83, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 0 0 1px rgba(217, 83, 83, 0.12),
    0 16px 28px rgba(217, 83, 83, 0.08);
}

body[data-theme="light"] .spyfall-player__value--spy {
  color: #c83f3f;
}

.player-card--active {
  border-color: rgba(42, 142, 130, 0.52);
  box-shadow: 0 0 0 1px rgba(42, 142, 130, 0.18), 0 18px 34px rgba(42, 142, 130, 0.12);
}

.player-card--self {
  background:
    radial-gradient(circle at top right, rgba(93, 134, 223, 0.12), transparent 28%),
    var(--panel);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  font-weight: 800;
}

.turn-chip--live {
  background: linear-gradient(135deg, rgba(93, 134, 223, 0.92), rgba(42, 142, 130, 0.92));
  color: #fff;
  border-color: transparent;
}

.turn-chip--action {
  cursor: pointer;
  background: linear-gradient(135deg, rgba(255, 163, 85, 0.96), rgba(255, 119, 56, 0.96));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 16px 28px rgba(255, 119, 56, 0.18);
}

.turn-chip--action:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(255, 119, 56, 0.22);
}

.turn-chip--action:active {
  transform: translateY(0);
}

.is-blurred {
  filter: blur(7px);
}

.ghost-button--warn {
  border-color: rgba(217, 106, 91, 0.34);
  color: var(--spyfall-red);
}

.ghost-button--warn:hover {
  box-shadow: 0 16px 28px rgba(217, 106, 91, 0.12);
}

body[data-theme="light"] .spyfall-briefing,
body[data-theme="light"] .summary-box,
body[data-theme="light"] .accusation-box,
body[data-theme="light"] .spyfall-player,
body[data-theme="light"] .location-board,
body[data-theme="light"] .spyfall-player__row,
body[data-theme="light"] .spyfall-score,
body[data-theme="light"] .status-pill,
body[data-theme="light"] .location-tile {
  background: rgba(255, 250, 243, 0.94);
}

body[data-theme="light"] .location-tile__image-wrap {
  background: linear-gradient(180deg, rgba(241, 233, 220, 0.98), rgba(229, 219, 205, 0.92));
}

body[data-theme="light"] .location-board {
  background:
    linear-gradient(180deg, rgba(240, 225, 199, 0.18), transparent 26%),
    rgba(255, 250, 243, 0.94);
}

body[data-theme="light"] .location-tile--masked .location-tile__image {
  filter: none;
}

@media (max-width: 1180px) {
  .spyfall-layout {
    grid-template-columns: 184px minmax(0, 1fr) 184px;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .topbar__actions {
    width: 100%;
    justify-content: flex-end;
  }

  .location-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .spyfall-layout {
    grid-template-columns: 1fr;
  }

  .topbar__line {
    flex-wrap: wrap;
  }

  .topbar__room-meta {
    width: 100%;
    flex-wrap: wrap;
  }

  .location-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .main-panel__head,
  .location-board__label {
    flex-direction: column;
    align-items: stretch;
  }

  .main-panel__meta,
  .lobby-actions,
  .accusation-box__actions {
    width: 100%;
  }

  .lobby-actions > *,
  .accusation-box__actions > * {
    flex: 1 1 0;
  }

  .location-grid {
    grid-template-columns: 1fr;
  }

  .player-card__head,
  .player-card__body {
    flex-direction: column;
    align-items: stretch;
  }
}
