@import url("https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=JetBrains+Mono:wght@500;700&display=swap");

:root {
  --steel-950: #06080b;
  --steel-900: #0d131a;
  --steel-850: #141c25;
  --steel-800: #1a242f;
  --steel-700: #2a3847;
  --steel-500: #6d8094;
  --steel-300: #afbcc9;
  --steel-150: #dbe4ec;
  --line-soft: rgba(189, 210, 230, 0.2);
  --line-hard: rgba(189, 210, 230, 0.35);
  --shadow-heavy: 0 24px 56px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: auto;
  color: var(--steel-150);
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 460px at 0% -10%, rgba(78, 103, 125, 0.22), transparent 60%),
    radial-gradient(950px 420px at 100% 0%, rgba(48, 63, 78, 0.24), transparent 62%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 8px),
    linear-gradient(170deg, var(--steel-950), var(--steel-900) 52%, #05070a 100%);
}


.board-panel.dragging-card {
  overflow-x: hidden;
  touch-action: none;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px 16px 16px;
}

.app-header {
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(180, 205, 230, 0.08), rgba(180, 205, 230, 0.02));
  box-shadow: inset 0 1px 0 rgba(220, 235, 248, 0.12);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--steel-300);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.game-title {
  margin: 0;
  color: #eef5fb;
  font-size: clamp(30px, 3.8vw, 54px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.38);
}

.app-main {
  display: block;
}

.board-panel {
  position: relative;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}



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

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

.hud-button {
  padding: 7px 12px;
  border: 1px solid rgba(195, 217, 238, 0.35);
  border-radius: 9px;
  color: #eaf2f9;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  background: rgba(8, 13, 20, 0.58);
}

.table {
  width: 100%;
  height: min(740px, calc(100vh - 176px));
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid rgba(190, 210, 230, 0.18);
  touch-action: pan-x pan-y;
  background:
    radial-gradient(1200px 900px at 30% 16%, #2b3a4a 0%, #141d27 58%, #0a1016 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.015) 0 2px, transparent 2px 7px);
}

.table.is-paused .card,
.table.is-paused .deck {
  visibility: hidden;
  pointer-events: none;
}

.table.is-paused::after {
  content: "Paused";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #eaf2f9;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: clamp(28px, 6vw, 64px);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(5, 9, 14, 0.6);
  z-index: 6;
  pointer-events: none;
}
.card {
  width: 120px;
  height: 170px;
  position: absolute;
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #8c96a0;
  color: #121416;
  cursor: grab;
  user-select: none;
  touch-action: pan-x;
  background: linear-gradient(145deg, #eef2f5, #b8c1c8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 6px 14px rgba(0, 0, 0, 0.45);
}

.card:active {
  cursor: grabbing;
}

.card.brass {
  border: 1px solid #8f6219;
  color: #121416;
  background: linear-gradient(145deg, #f2d28b, #b57a1c);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 6px 14px rgba(0, 0, 0, 0.45);
}

.corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 14px;
  font-weight: 800;
  line-height: 0.92;
  pointer-events: none;
}

.corner.bottom {
  transform: rotate(180deg);
  transform-origin: center center;
}

.corner .icon {
  margin-top: 2px;
  font-size: 14px;
}

.center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.deck {
  width: 74px;
  height: 110px;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(205, 220, 235, 0.22);
  color: #e6edf4;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(145deg, #2e3945, #1a2129);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.52),
    0 10px 22px rgba(0, 0, 0, 0.5);
}

.deck::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.deck .label {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.11em;
}

.deck .count {
  position: absolute;
  right: 6px;
  bottom: 6px;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(235, 244, 252, 0.18);
  color: #f4f8fc;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.status {
  position: static;
  padding: 6px 10px;
  border: 1px solid rgba(190, 214, 236, 0.32);
  border-radius: 9px;
  color: #eaf2f9;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(6, 10, 16, 0.58);
  backdrop-filter: blur(2px);
  pointer-events: none;
}
.status.is-paused {
  opacity: 0.55;
  border-color: rgba(190, 214, 236, 0.2);
}
.key {
  cursor: default;
}

.selected {
  outline: 3px solid rgba(255, 220, 88, 0.95);
}

.won {
  outline: 4px solid rgba(113, 237, 175, 0.9);
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.68);
  z-index: 2147483647;
}

.modal-card {
  min-width: 320px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  color: #e8f1f9;
  background: linear-gradient(175deg, #1a2735, #111a24 72%);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.46);
}

.modal-card h2 {
  margin: 0 0 12px;
  font-size: 28px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.modal-card button {
  margin-top: 12px;
  padding: 10px 16px;
  border: 1px solid rgba(233, 245, 255, 0.35);
  border-radius: 9px;
  color: #f2f7fb;
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(180deg, #31607f, #22435a);
}

.modal-card button.secondary {
  border-color: rgba(200, 220, 240, 0.26);
  background: linear-gradient(180deg, #293847, #1a2734);
}

.share-card {
  width: min(92vw, 560px);
  border: 1px solid rgba(191, 212, 233, 0.4);
  background:
    radial-gradient(760px 260px at 50% -25%, rgba(140, 176, 209, 0.22), transparent 65%),
    linear-gradient(170deg, #1b2835 0%, #121b24 72%, #0e151d 100%);
}

.share-card .share-eyebrow {
  margin: 0 0 8px;
  color: #bcd2e5;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.share-card h2 {
  margin: 0;
  color: #f0f6fc;
  font-size: clamp(26px, 5vw, 44px);
  letter-spacing: 0.03em;
}

.share-card .share-label {
  margin: 14px 0 6px;
  color: #c7d9ea;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.final-time {
  margin: 0;
  border: 1px solid rgba(204, 224, 243, 0.4);
  border-radius: 14px;
  padding: 12px 18px;
  color: #f7fbff;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: clamp(42px, 10vw, 84px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  background:
    linear-gradient(180deg, rgba(170, 199, 225, 0.2), rgba(170, 199, 225, 0.08)),
    linear-gradient(145deg, rgba(22, 35, 47, 0.9), rgba(9, 14, 20, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 16px 34px rgba(0, 0, 0, 0.42);
}

.share-card .share-caption {
  margin: 12px 0 0;
  color: #b5c9dc;
  font-size: 18px;
}

.share-card .share-mode {
  margin: 8px 0 0;
  color: #d7e6f4;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.start-card {
  width: min(92vw, 560px);
  border: 1px solid rgba(191, 212, 233, 0.4);
  background:
    radial-gradient(760px 260px at 50% -25%, rgba(140, 176, 209, 0.2), transparent 65%),
    linear-gradient(170deg, #1b2835 0%, #121b24 72%, #0e151d 100%);
}

.start-card h2 {
  margin: 0;
  color: #f0f6fc;
  font-size: clamp(30px, 5.5vw, 52px);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.start-actions {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.start-actions button {
  width: 100%;
  margin-top: 0;
  font-size: 20px;
  padding: 12px 16px;
}

.rules-card {
  width: min(94vw, 760px);
  max-height: min(88vh, 900px);
  overflow: auto;
  text-align: left;
  border: 1px solid rgba(191, 212, 233, 0.4);
  background:
    radial-gradient(900px 300px at 50% -20%, rgba(142, 176, 208, 0.2), transparent 64%),
    linear-gradient(170deg, #1b2835 0%, #121b24 72%, #0e151d 100%);
}

.rules-card h3 {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.rules-card h4 {
  margin: 10px 0 5px;
  color: var(--steel-300);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rules-card p {
  margin: 0 0 10px;
  color: #c8d5e1;
  font-size: 21px;
  line-height: 1.35;
}

.rules-card .instruction-label {
  margin: 0 0 2px;
  color: #e8f0f7;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.rules-card strong {
  color: #f2f7fc;
}

.rules-card .example {
  margin-top: 10px;
  border-radius: 9px;
  border: 1px solid var(--line-hard);
  padding: 10px;
  color: #dfe8f1;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 18px;
  line-height: 1.33;
  background: linear-gradient(180deg, rgba(4, 6, 9, 0.52), rgba(4, 6, 9, 0.85));
}

.rules-card .instruction-footer {
  margin-top: 14px;
  color: var(--steel-300);
}
.is-hidden {
  display: none !important;
}

@media (max-width: 1220px) {
  .app-main {
    display: block;
  }
}

@media (max-width: 980px) {
  .app-shell {
    padding: 16px 8px 10px;
  }

  .app-main {
    display: block;
  }

  

  .table {
    padding: 12px 10px;
  }
}

@media (max-width: 760px) {
  .game-controls {
    gap: 8px;
  }
  .app-shell {
    padding: 12px 2px 8px;
  }

  .app-header {
    padding: 8px 10px;
  }

  .game-title {
    font-size: clamp(22px, 8vw, 36px);
  }



  

  .table {
    border-radius: 8px;
    padding: 8px 6px;
    height: min(740px, calc(100vh - 144px));
  }

  .status {
    font-size: 13px;
    padding: 5px 8px;
  }
  .rules-card p,
  .rules-card .example {
    font-size: 14px;
  }

  .rules-card .instruction-label {
    font-size: 17px;
  }

  .hud-button {
    font-size: 12px;
    padding: 6px 9px;
  }
}
