/* Sandbox page: builds on styles.css tokens. */

.play { padding-top: 56px; padding-bottom: 96px; }
.play__intro { max-width: 820px; margin-bottom: 40px; }
.play__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 6.4vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 14px 0 18px;
}
.play__title em { font-style: italic; color: var(--mint); }
.play__lede { color: var(--soft); font-size: 17.5px; line-height: 1.6; max-width: 70ch; }
.play__lede a { color: var(--text); }
.play__status { margin-top: 14px; font-size: 13.5px; color: var(--muted); font-family: var(--mono); }
.play__status.is-ready { color: var(--mint); }
.play__status.is-error { color: #ff8a7a; }

.btn--small { min-height: 38px; padding: 0 16px; font-size: 14px; }
button.btn { cursor: pointer; border: 1px solid transparent; font-family: var(--sans); }
button.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.play__grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.05fr) minmax(280px, 1fr) minmax(300px, 1.1fr);
  gap: 20px;
  align-items: start;
}

/* The pot: a paper ticket */
.pot-card {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 24px 60px rgba(0, 0, 0, 0.45);
  position: sticky;
  top: 20px;
}
.pot-card__top { display: flex; justify-content: space-between; align-items: center; }
.pot-card__label { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.badge {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1.5px solid var(--ink);
  background: var(--mint);
  color: var(--mint-ink);
}
.badge[data-phase="closed"] { background: #ffd66b; }
.badge[data-phase="drawn"] { background: #9fd3ff; }
.badge[data-phase="refunding"] { background: #ffb4a6; }
.badge[data-phase="claimed"] { background: var(--ink); color: var(--paper); }
.pot-card__value { font-family: var(--serif); font-size: clamp(48px, 5vw, 66px); line-height: 1; margin: 18px 0 6px; transition: color 200ms; }
.pot-card__value em { font-style: italic; font-size: 0.45em; color: var(--ink-soft); }
.pot-card__value.is-bump { color: #0c8a4f; }
.pot-card__line { color: var(--ink-soft); font-size: 14.5px; margin: 0 0 16px; min-height: 2.6em; }
.pot-card__facts { display: grid; gap: 8px; margin: 0 0 18px; padding: 14px 0; border-top: 1px dashed rgba(18, 18, 16, 0.25); border-bottom: 1px dashed rgba(18, 18, 16, 0.25); }
.pot-card__facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.pot-card__facts dt { color: var(--ink-soft); }
.pot-card__facts dd { margin: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.pot-card__facts code { font-family: var(--mono); font-size: 12px; }

.clock__head { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-soft); }
.clock__head strong { font-family: var(--mono); color: var(--ink); font-size: 15px; }
.clock__rail { position: relative; height: 6px; background: var(--paper-2); border-radius: 99px; margin: 22px 0 30px; }
.clock__fill { position: absolute; inset: 0 auto 0 0; width: 3%; background: var(--ink); border-radius: 99px; transition: width 300ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.clock__mark { position: absolute; top: -18px; transform: translateX(-50%); font-family: var(--mono); font-size: 11px; color: var(--ink-soft); }
.clock__mark::after { content: attr(data-label); position: absolute; top: 30px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: var(--sans); font-size: 10.5px; }
.clock__mark::before { content: ""; position: absolute; left: 50%; top: 15px; width: 2px; height: 12px; background: var(--ink-soft); transform: translateX(-50%); }
.clock__buttons { display: flex; gap: 8px; }
.pot-card .btn--ghost { color: var(--ink); border-color: rgba(18, 18, 16, 0.3); background: transparent; }
.pot-card .btn--ghost:hover { border-color: var(--ink); }

.tickets { margin-top: 18px; }
.tickets__label { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.tickets__list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tickets__list li {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(18, 18, 16, 0.15);
}
.tickets__list li b { font-family: var(--mono); }
.tickets__list li.is-winner { background: var(--mint); border-color: var(--ink); }
.tickets__list li.tickets__empty { background: none; border: none; color: var(--ink-soft); padding-left: 0; }

/* Panels */
.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel__title { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 0 0 16px; line-height: 1.05; }
.panel__note { color: var(--muted); font-size: 14px; margin: -6px 0 16px; }
.moves { display: grid; gap: 16px; }
.move { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; }
.move__step { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 13px; color: var(--soft); }
.move__name { margin: 3px 0 8px; font-weight: 600; font-size: 15px; }
.move__hint { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
.move__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.play__reset { margin-top: 22px; }

.cheats { display: grid; gap: 10px; }
.cheat {
  text-align: left;
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text);
  cursor: pointer;
  font-family: var(--sans);
  transition: border-color 150ms, transform 150ms;
}
.cheat:hover { border-color: #ff8a7a; transform: translateY(-1px); }
.cheat__title { font-weight: 600; font-size: 15px; display: flex; justify-content: space-between; gap: 10px; }
.cheat__title span { color: #ff8a7a; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.cheat__what { color: var(--muted); font-size: 13.5px; margin-top: 4px; line-height: 1.45; }
.cheat.is-refused { border-color: rgba(255, 138, 122, 0.6); }
.cheat.is-refused .cheat__title span::before { content: "✗ "; }

/* Log */
.log { margin-top: 28px; }
.log__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.log__legend { font-size: 13px; color: var(--muted); display: flex; gap: 14px; }
.ok { color: var(--mint); }
.no { color: #ff8a7a; }
.log__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.log__list li { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; animation: pop 260ms cubic-bezier(0.2, 0.9, 0.25, 1.2); }
.log__list li.log__empty { display: block; color: var(--muted); animation: none; }
.log__mark { font-size: 18px; line-height: 1.2; }
.log__label { font-weight: 600; }
.log__detail { color: var(--muted); font-size: 13.5px; margin-top: 3px; line-height: 1.5; }
.log__detail code { font-family: var(--mono); font-size: 12.5px; color: var(--soft); }
.log__why { color: var(--soft); font-size: 13.5px; margin-top: 4px; }
.log__meta { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.log__list li.is-attack { border-color: rgba(255, 138, 122, 0.35); }
.log__list li.is-time { opacity: 0.75; }

@keyframes pop { from { transform: translateY(6px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }

.covenant { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; background: var(--bg-2); }
.covenant summary { cursor: pointer; font-weight: 600; }
.covenant pre { overflow: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; color: var(--soft); max-height: 520px; margin: 14px 0 0; white-space: pre; }

@media (max-width: 1080px) {
  .play__grid { grid-template-columns: 1fr 1fr; }
  .pot-card { position: static; grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .play { padding-top: 32px; }
  .play__grid { grid-template-columns: 1fr; }
  .log__list li { grid-template-columns: 22px 1fr; }
  .log__meta { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .log__list li, .clock__fill, .cheat { animation: none; transition: none; }
}

/* Secondary buttons on the dark panels (the site's ghost button is styled for its hero). */
.panel .btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-2);
}
.panel .btn--ghost:hover { border-color: var(--mint); color: var(--mint); }
.panel .btn--solid { border: 1px solid var(--mint); }
