* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #151720;
  color: #ffffff;
}

button,
input {
  font: inherit;
}

.app {
  min-height: 100vh;
  padding: 32px;
}

.header {
  max-width: 1000px;
  margin: 0 auto 24px;
  text-align: center;
}

.header h1 {
  margin: 0 0 8px;
  font-size: 40px;
}

.header p {
  margin: 0;
  color: #b9bfd3;
}

.layout {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 20px;
  align-items: start;
}

.card {
  background: #222637;
  border: 1px solid #343a52;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

.card h2 {
  margin: 0 0 18px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field span,
.icon-area p {
  color: #d7dbea;
  font-weight: bold;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #4b536d;
  border-radius: 10px;
  background: #151720;
  color: #ffffff;
  outline: none;
}

.field input:focus {
  border-color: #7c8cff;
}

.icon-area {
  margin-bottom: 18px;
}

.icons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.icon-button {
  min-height: 52px;
  border: 1px solid #4b536d;
  border-radius: 12px;
  background: #2d3348;
  color: #ffffff;
  font-weight: bold;
  cursor: pointer;
}

.icon-button:hover:not(:disabled) {
  background: #39415d;
}

.icon-button.selected {
  background: #5967ff;
  border-color: #8992ff;
}

.icon-button.taken,
.icon-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.enter-button {
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: #00b894;
  color: #ffffff;
  font-weight: bold;
  cursor: pointer;
}

.enter-button:hover {
  background: #00a383;
}

.error {
  margin: 14px 0 0;
  color: #ff7675;
}

.hint {
  margin: 14px 0 0;
  color: #b9bfd3;
}

.lobby-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #151720;
  color: #d7dbea;
  font-weight: bold;
}

.lobby-table {
  width: 100%;
  border-collapse: collapse;
}

.lobby-table th,
.lobby-table td {
  padding: 13px 10px;
  border-bottom: 1px solid #343a52;
  text-align: left;
}

.lobby-table th {
  color: #b9bfd3;
  font-size: 14px;
}

.lobby-table td {
  color: #ffffff;
}

.empty {
  text-align: center;
  color: #b9bfd3;
}

.timer-box {
  max-width: 1000px;
  margin: 20px auto 0;
  padding: 18px;
  border-radius: 16px;
  text-align: center;
  font-weight: bold;
  background: #222637;
  border: 1px solid #343a52;
}

.timer-box.idle {
  color: #b9bfd3;
}

.timer-box.waiting {
  color: #fdcb6e;
}

.timer-box.ready {
  color: #74b9ff;
}

.timer-box.game-starting {
  color: #55efc4;
  font-size: 24px;
}

.future-note {
  max-width: 1000px;
  margin: 14px auto 0;
  color: #b9bfd3;
  text-align: center;
}

.future-note code {
  color: #ffffff;
  background: #222637;
  padding: 3px 6px;
  border-radius: 6px;
}

/* @media (max-width: 800px) {
  .app {
    padding: 20px;
  }

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

  .header h1 {
    font-size: 32px;
  }
} */

.game-container {
  display: flex;
  justify-content: center;
  align-items: center;
  
}

.game-board {
  position: relative;
}

.grid {
  display: grid;
  grid-template-columns: repeat(13, 36px);
  grid-template-rows: repeat(13, 36px);
  background: #2D6E2D;
  position: relative;
  border: 2px solid #1a4d1a;
}

.cell--wall {
  background: #6B7280;
  outline: 1px solid #4B5563;
}

.cell--block {
  background: #B94040;
  outline: 1px solid #8B2020;
}

.cell--empty {
  background: transparent;
}

.powerup {
  position: absolute;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  pointer-events: none;
}

.powerup__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  animation: powerup-pulse 0.9s infinite alternate;
}

.powerup--flames {
  text-shadow: 0 0 8px rgba(255, 120, 0, 0.9);
}

@keyframes powerup-pulse {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.15);
  }
}

.player {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  top: 4px;
  left: 4px;
  transition: transform 0.08s linear;
  z-index: 2;
  border: 2px solid rgba(0, 0, 0, 0.2);
}

.player--p1 {
  background: #F5C542;
}

.player--p2 {
  background: #E24B4A;
}

.player--p3 {
  background: #378ADD;
}

.player--p4 {
  background: #D4537E;
}

.bomb {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #1a1a1a;
  border-radius: 50%;
  top: 8px;
  left: 8px;
  z-index: 2;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

.game-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px auto;
  gap: 24px;
  align-items: start;
  justify-content: center;
  padding: 32px;
}

.lives-panel {
  background: #222637;
  border: 1px solid #343a52;
  border-radius: 16px;
  padding: 18px;
  color: #ffffff;
}

.lives-panel h3 {
  margin: 0 0 16px;
  font-size: 20px;
}

.life-row {
  display: grid;
  grid-template-columns: 42px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #343a52;
}

.life-row:last-child {
  border-bottom: 0;
}

.pu-badge {
  font-size: 11px;
  font-weight: bold;
  color: #ffcc00;
  white-space: nowrap;
}

.life-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  font-weight: bold;
  background: #151720;
}

.life-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.life-hearts {
  display: inline-flex;
  gap: 3px;
}

.life-heart {
  font-size: 18px;
}

.life-heart--active {
  color: #ff5c7a;
}

.life-heart--lost {
  color: #555b70;
}

/* @media (max-width: 900px) {
  .game-screen {
    grid-template-columns: 1fr;
  }

  .lives-panel {
    max-width: 468px;
    margin: 0 auto;
    width: 100%;
  }
} */

.explosion {
  position: absolute;
  width: 36px;
  height: 36px;
  background: #EF9F27;
  opacity: 0.85;
  z-index: 3;
  pointer-events: none;
  top: 0;
  left: 0;
}

.explosion--fading {
  opacity: 0.3;
}

.game-over {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.game-over-content {
  background: #222637;
  border: 2px solid #343a52;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
}

.game-over-content h2 {
  margin: 0 0 24px;
  font-size: 32px;
  color: #55efc4;
}

.game-over-content button {
  padding: 12px 32px;
  background: #00b894;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
}

.game-over-content button:hover {
  background: #00a383;
}

.game-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-size: 24px;
  color: #b9bfd3;
}

.game-sidebar {
  display: grid;
  gap: 16px;
}

.game-chat {
  background: #222637;
  border: 1px solid #343a52;
  border-radius: 16px;
  padding: 16px;
  color: #ffffff;
  /* width: 240px; */
}

.game-chat__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.game-chat__header h3 {
  margin: 0;
  font-size: 20px;
}

.game-chat__header span {
  min-width: 28px;
  min-height: 28px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 999px;
  background: #151720;
  color: #b9bfd3;
  font-size: 13px;
  font-weight: bold;
}

.game-chat__messages {
  height: 220px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
  margin-bottom: 12px;
}

.game-chat__empty {
  margin: 0;
  color: #b9bfd3;
  font-size: 14px;
}

.game-chat__message {
  background: #151720;
  border: 1px solid #343a52;
  border-radius: 12px;
  padding: 10px;
}

.game-chat__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}

.game-chat__meta strong {
  font-size: 13px;
}

.game-chat__meta time {
  margin-left: auto;
  color: #8f96ad;
  font-size: 11px;
}

.game-chat__icon {
  min-width: 26px;
  min-height: 26px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background: #2d3348;
  font-size: 11px;
  font-weight: bold;
}

.game-chat__message p {
  margin: 0;
  color: #d7dbea;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.game-chat__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.game-chat__form input {
  min-width: 0;
  padding: 10px;
  border: 1px solid #4b536d;
  border-radius: 10px;
  background: #151720;
  color: #ffffff;
  outline: none;
}

.game-chat__form input:focus {
  border-color: #7c8cff;
}

.game-chat__form button {
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: #5967ff;
  color: #ffffff;
  font-weight: bold;
  cursor: pointer;
}

.game-chat__form button:hover {
  background: #4a56d8;
}

/* @media (max-width: 800px) {
  .game-sidebar,
  .game-chat {
    width: 100%;
  }
} */