:root {
  color-scheme: light;
  font-family: ui-rounded, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f3dfb8;
  color: #2c1c10;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 171, 89, 0.55), transparent 18rem),
    radial-gradient(circle at 82% 12%, rgba(120, 201, 115, 0.44), transparent 22rem),
    linear-gradient(135deg, #fff4cf 0%, #c9e6b4 48%, #775034 100%);
}

button {
  border: 0;
  border-radius: 999px;
  background: #2f7a3d;
  color: #fff7dc;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0.9rem 1.2rem;
  box-shadow: 0 12px 26px rgba(48, 84, 35, 0.24);
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.8);
  opacity: 0.5;
}

.home-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 3;
  color: #2d2015;
  font-weight: 900;
  text-decoration: none;
}

.shell {
  width: min(1220px, calc(100% - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(17rem, 24rem) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  padding: 4rem 0 2rem;
}

.intro,
.game-card,
.pot-mini {
  border: 1px solid rgba(79, 53, 29, 0.18);
  background: rgba(255, 249, 225, 0.74);
  box-shadow: 0 24px 70px rgba(66, 47, 26, 0.22);
  backdrop-filter: blur(16px);
}

.intro,
.game-card { border-radius: 2rem; }
.intro { padding: clamp(1.4rem, 4vw, 2.2rem); }

.eyebrow {
  color: #9d4a1d;
  font-size: 0.8rem;
  font-weight: 1000;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0.2rem 0 0;
  font-size: clamp(3.1rem, 7vw, 5.7rem);
  line-height: 0.84;
  letter-spacing: -0.075em;
}

.lede,
.rules {
  color: #58422e;
  font-size: 1.02rem;
  line-height: 1.55;
}

.join-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.4rem 0; }
.rules { display: grid; gap: 0.35rem; }
.rules strong { color: #2f7a3d; }

.game-card { padding: clamp(0.8rem, 2vw, 1.2rem); }

.topbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.8rem;
}

.topbar div,
.game-message {
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.55);
  padding: 0.7rem 0.85rem;
}

.topbar span {
  display: block;
  color: #7a6047;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

canvas {
  display: block;
  width: 100%;
  border: 8px solid rgba(88, 56, 28, 0.22);
  border-radius: 1.5rem;
  background: #f6ddb7;
}

.game-message {
  margin: 0.8rem 0;
  color: #3f2c1d;
  font-weight: 850;
}

.actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.55rem;
}

.actions button:nth-child(2) { background: #8b5a2b; }
.actions button:nth-child(3) { background: #d18b24; }
.actions button:nth-child(4) { background: #436f53; }
.actions button:nth-child(5) { background: #7e4f7f; }
.actions button:nth-child(6) { background: #5f6f33; }

.pot-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.pot-mini {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  padding: 0.75rem;
}

.pot-mini strong, .pot-mini span, .pot-mini small { position: relative; display: block; }
.pot-mini small { color: #6c543f; line-height: 1.35; }
.pot-mini i {
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--value);
  height: 0.36rem;
  background: #2f7a3d;
}

@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .topbar, .pot-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 1rem, 1220px); padding-top: 3.25rem; }
  .intro, .game-card { border-radius: 1.35rem; }
  .topbar, .pot-list, .actions { grid-template-columns: 1fr; }
  h1 { font-size: 3.2rem; }
}
