/* War — Playnesta original (MIT). Table, cards, buttons. */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}
body {
  background: radial-gradient(circle at 50% 18%, #2a1b46, #1a1028 70%);
  color: #f3ecff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: calc(var(--pn-vh, 1vh) * 100);
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  gap: 8px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.brand small {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.65;
  margin-left: 6px;
  text-transform: lowercase;
}
.meta span {
  font-size: 14px;
  opacity: 0.9;
}
.table {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 0;
}
.side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.side .who {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.75;
}
.slot {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pile {
  position: relative;
  width: 76px;
  height: 96px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pile .back {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: repeating-linear-gradient(45deg, #4b2e83, #4b2e83 6px, #3d2468 6px, #3d2468 12px);
  border: 2px solid #7c5cc4;
}
#you-pile .hint {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
#you-pile:active {
  transform: scale(0.97);
}
.card {
  display: inline-flex;
  width: 76px;
  height: 96px;
  border-radius: 10px;
  background: #fdfdf6;
  color: #1d1d24;
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}
.card.red {
  color: #c2233a;
}
.card .corner {
  position: absolute;
  top: 5px;
  left: 7px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
}
.card .pip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.card.back-card {
  background: repeating-linear-gradient(45deg, #4b2e83, #4b2e83 6px, #3d2468 6px, #3d2468 12px);
  border: 2px solid #7c5cc4;
}
.msg {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  min-height: 24px;
}
.warspoils {
  min-height: 20px;
  font-size: 13px;
  opacity: 0.85;
}
.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.btn {
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid #7c5cc4;
  background: #35245e;
  color: #f3ecff;
  cursor: pointer;
}
.btn.primary {
  background: #7c5cc4;
  color: #fff;
  border-color: #9c80d9;
}
.btn:active {
  transform: scale(0.97);
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 8, 20, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}
.overlay.hidden {
  display: none;
}
.panel {
  background: #241a3f;
  border: 1px solid #7c5cc4;
  border-radius: 16px;
  padding: 18px;
  max-width: 420px;
  width: 100%;
  max-height: 86vh;
  overflow: auto;
}
.panel h2 {
  margin: 0 0 10px;
  font-size: 20px;
}
.panel p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.5;
}
.panel-wide {
  max-width: 520px;
}
.rules-list {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.55;
}
.rules-list li {
  margin-bottom: 8px;
}
@media (max-height: 700px) {
  .card,
  .pile {
    width: 62px;
    height: 80px;
  }
  .slot {
    min-height: 80px;
  }
  .card .pip {
    font-size: 32px;
  }
  .brand {
    font-size: 19px;
  }
}
