:root {
  --line: #00c7d1;
  --line-soft: rgba(0, 199, 209, 0.45);
  --text: #d8f7f9;
  --muted: #8bbec4;
  --accent: #00dfe8;
  --card-w: 122px;
  --card-h: 171px;
  --tableau-gap: 28px;
}

body {
  cursor:
    url('/images/cursors/pointer.cur') 6 0,
    url('/images/cursors/pointer.png') 6 0,
    auto;
}

a,
button,
.card,
.pile,
.tableau-col,
#lbTable th,
#lbTable td {
  cursor:
    url('/images/cursors/hover.cur') 11 0,
    url('/images/cursors/hover.png') 11 0,
    pointer;
}

.game-shell {
  position: relative;
  overflow: visible;
  max-width: 1220px;
  margin: 0 auto;
}

.mobile-only-notice {
  display: none;
  max-width: 520px;
  margin: 20px auto;
  padding: 16px;
  text-align: center;
  background: rgba(15, 15, 15, 0.92);
  border: 1px solid #00cccc;
  border-radius: 8px;
  color: #e6e6e6;
}

.game-info {
  max-width: 860px;
  margin: 0 auto 14px;
  padding: 12px 16px;
  border: 1px solid #00cccc;
  border-radius: 10px;
  background: rgba(12, 19, 24, 0.88);
  box-shadow: 0 0 16px rgba(0, 255, 255, 0.15);
}

.game-info h3 {
  margin: 0 0 8px;
  color: #00dddd;
}

.game-info ul {
  margin: 0;
  padding-left: 20px;
  text-align: left;
}

.name-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0 auto 10px;
}

.name-bar label {
  font-size: 0.95rem;
}

.name-bar input[type="text"] {
  width: 220px;
  font-family: inherit;
  border-radius: 8px;
  border: 1px solid #007f7f;
  background: #0f1d21;
  color: #e8fafa;
  padding: 8px 12px;
}

.ui-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0 auto 12px;
}

.ui-bar button {
  font-family: inherit;
  border-radius: 8px;
  border: 1px solid #007f7f;
  background: #0f1d21;
  color: #e8fafa;
  padding: 8px 12px;
}

.ui-bar button:hover,
.ui-bar button:focus-visible {
  border-color: #00cccc;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.25);
}

.status-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.status-pill {
  border: 1px solid #00a9a9;
  border-radius: 999px;
  padding: 4px 12px;
  background: rgba(6, 26, 32, 0.84);
  min-width: 120px;
}

.board {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(4, 15, 24, 0.86), rgba(2, 10, 16, 0.9));
  box-shadow: 0 0 20px rgba(0, 199, 209, 0.24), inset 0 0 28px rgba(0, 199, 209, 0.07);
  padding: 14px;
}

.win-overlay {
  position: absolute;
  inset: 14px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 10, 16, 0.72);
  border-radius: 10px;
  z-index: 20;
}

.win-overlay.is-visible {
  display: flex;
}

.win-panel {
  max-width: 460px;
  padding: 18px 22px;
  text-align: center;
  border: 1px solid #00dfe8;
  border-radius: 10px;
  background: rgba(6, 24, 33, 0.95);
  box-shadow: 0 0 20px rgba(0, 223, 232, 0.32);
}

.win-panel h2 {
  margin: 0 0 10px;
  color: #9fffbe;
  text-shadow: 0 0 10px rgba(159, 255, 190, 0.3);
}

.win-panel p {
  margin: 0 0 12px;
  color: #d9f6f8;
  font-size: 1rem;
}

.top-row {
  display: grid;
  grid-template-columns: repeat(2, var(--card-w)) 1fr repeat(4, var(--card-w));
  gap: 10px;
  align-items: start;
  margin-bottom: 16px;
}

.pile-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pile-label {
  color: var(--muted);
  text-align: center;
  font-size: 0.86rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pile {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  border: 1px dashed rgba(0, 199, 209, 0.55);
  border-radius: 10px;
  background: rgba(2, 12, 18, 0.6);
}

.pile.valid-drop,
.tableau-col.valid-drop {
  border-color: #00dfe8;
  box-shadow: 0 0 14px rgba(0, 223, 232, 0.42);
}

.tableau-row {
  display: grid;
  grid-template-columns: repeat(7, var(--card-w));
  gap: 10px;
  justify-content: center;
  min-height: calc(var(--card-h) + var(--tableau-gap) * 12 + 8px);
  overflow: visible;
}

.tableau-col {
  position: relative;
  min-height: calc(var(--card-h) + var(--tableau-gap) * 12);
  border-radius: 10px;
  border: 1px dashed rgba(0, 199, 209, 0.24);
  background: rgba(0, 0, 0, 0.08);
}

.card {
  position: absolute;
  left: 0;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 10px;
  border: 1px solid #2d3e50;
  background: linear-gradient(180deg, #f8f9fb, #dfe4ea);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42);
  user-select: none;
  cursor:
    url('/images/cursors/hover.cur') 11 0,
    url('/images/cursors/hover.png') 11 0,
    pointer;
  display: flex;
  padding: 0;
}

.card.face-down {
  background: radial-gradient(circle at 24% 18%, rgba(0, 214, 225, 0.22), rgba(6, 20, 34, 0.95) 60%),
    repeating-linear-gradient(45deg, rgba(0, 195, 211, 0.22), rgba(0, 195, 211, 0.22) 5px, rgba(7, 24, 33, 0.9) 5px, rgba(7, 24, 33, 0.9) 10px);
  border-color: #11a9b7;
}

.card.face-down .card-face {
  display: none;
}

.card.face-down .card-back {
  display: flex;
}

.card-face {
  display: flex;
  width: 100%;
  height: 100%;
}

.card-back {
  display: none;
  flex: 1;
  align-items: center;
  justify-content: center;
}

.card-art,
.back-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9px;
  display: block;
}

.card.selected {
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 223, 232, 0.3), 0 8px 22px rgba(0, 0, 0, 0.5);
}

.message {
  min-height: 1.4em;
  margin: 10px auto 14px;
  color: #9ceef4;
  text-align: center;
}

.message.win {
  color: #9fffbe;
}

.message.warn {
  color: #ffcf95;
}

.leaderboard {
  max-width: 860px;
  margin: 8px auto 0;
}

.leaderboard h2 {
  margin: 10px 0;
  color: #00dede;
  font-size: 1.2rem;
}

#lbTable {
  width: 100%;
  border-collapse: collapse;
  background: rgba(5, 17, 22, 0.86);
  border: 1px solid #008b8b;
}

#lbTable th,
#lbTable td {
  border: 1px solid rgba(0, 139, 139, 0.75);
  padding: 8px 6px;
  font-size: 0.92rem;
}

#lbTable th {
  background: rgba(0, 204, 204, 0.14);
  color: #aefefe;
}

#lbTable .empty-cell {
  color: #8fc8c8;
  font-style: italic;
}

@media (max-width: 1200px) {
  :root {
    --card-w: 106px;
    --card-h: 149px;
    --tableau-gap: 24px;
  }

  .board {
    max-width: 980px;
  }
}

@media (max-width: 980px) {
  :root {
    --card-w: 92px;
    --card-h: 128px;
    --tableau-gap: 20px;
  }

  .top-row {
    grid-template-columns: repeat(2, var(--card-w)) 10px repeat(4, var(--card-w));
    justify-content: center;
  }

  .spacer {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --card-w: 78px;
    --card-h: 109px;
    --tableau-gap: 18px;
  }

  .top-row {
    gap: 8px;
  }

  .ui-bar {
    gap: 8px;
  }
}

@media (max-width: 900px) {
  .mobile-only-notice {
    display: block;
  }

  .desktop-game {
    display: none;
  }
}
