:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d8dce3;
  --brand: #0066cc;
  --brand-soft: #eaf3ff;
  --green: #1d7f45;
  --amber: #b45309;
  --red: #d70015;
  --shadow: 0 24px 70px rgb(17 24 39 / 14%);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(90deg, rgb(0 102 204 / 7%) 1px, transparent 1px),
    linear-gradient(0deg, rgb(180 83 9 / 7%) 1px, transparent 1px),
    radial-gradient(circle at 82% 18%, rgb(0 102 204 / 10%), transparent 30%),
    radial-gradient(circle at 12% 88%, rgb(29 127 69 / 10%), transparent 32%),
    linear-gradient(135deg, #fbfbfd 0%, #f5f5f7 56%, #f8fbf0 100%);
  background-size:
    74px 74px,
    74px 74px,
    auto,
    auto,
    auto;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.options button:disabled,
.tiles button:disabled,
.board button:disabled,
.lanes button:disabled {
  color: var(--text);
  -webkit-text-fill-color: currentColor;
  opacity: 0.84;
}

.options button:disabled span,
.tiles button:disabled span,
.board button:disabled span,
.lanes button:disabled span {
  color: var(--muted);
  -webkit-text-fill-color: currentColor;
}

.options button:disabled.selected,
.tiles button:disabled.selected,
.board button:disabled.selected,
.lanes button:disabled.selected {
  opacity: 0.95;
}

#app {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.hero,
.play,
.result,
.history {
  border: 1px solid rgb(216 220 227 / 78%);
  background: rgb(255 255 255 / 88%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: flex;
  min-height: 126px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: 32px;
  padding: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.95;
  letter-spacing: 0;
}

.meta {
  display: grid;
  min-width: min(420px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.meta span {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  padding: 12px 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.play {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.88fr);
  gap: 20px;
  margin-top: 20px;
  border-radius: 34px;
  padding: 20px;
}

.prompt {
  display: grid;
  min-height: 560px;
  align-content: center;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgb(0 102 204 / 12%), transparent 42%),
    linear-gradient(145deg, #ffffff 0%, #f8fafc 58%, #fff8ed 100%);
  padding: 38px;
}

.prompt > strong {
  display: block;
  color: var(--text);
  font-size: clamp(50px, 8vw, 96px);
  line-height: 0.95;
}

.prompt > span {
  display: block;
  max-width: 600px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}

.angle-stage {
  display: grid;
  width: min(100%, 540px);
  min-height: 282px;
  place-items: center;
  margin-top: 32px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgb(255 255 255 / 82%);
}

.angle-stage .angle-svg {
  width: min(430px, 100%);
  height: 260px;
}

.angle-svg path,
.angle-svg line {
  fill: none;
  stroke: var(--text);
  stroke-linecap: round;
  stroke-width: 8;
}

.angle-svg .arc {
  stroke: var(--brand);
  stroke-width: 7;
}

.angle-svg .ray {
  stroke: var(--amber);
}

.angle-svg circle {
  fill: var(--brand);
}

.angle-svg text {
  fill: var(--brand);
  font-size: 20px;
  font-weight: 850;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  padding: 18px;
}

.stake {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.stake input {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 18px;
  outline: none;
  padding: 0 16px;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
}

.stake input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.options button {
  display: grid;
  min-height: 158px;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface-soft);
  padding: 12px;
  text-align: left;
}

.options .angle-svg {
  width: 100%;
  height: 88px;
}

.options .angle-svg path,
.options .angle-svg line {
  stroke-width: 10;
}

.options button strong {
  font-size: 32px;
  letter-spacing: 0;
}

.options button span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.options button.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.angle-button {
  min-height: 58px;
  border: 0;
  border-radius: 20px;
  background: var(--text);
  color: #fff;
  font-size: 17px;
  font-weight: 850;
}

.result {
  display: flex;
  min-height: 126px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
  border-radius: 30px;
  padding: 26px 28px;
}

.result strong {
  display: block;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
}

.result span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.result.win {
  border-color: rgb(29 127 69 / 40%);
  background: linear-gradient(135deg, #ecfdf5, #ffffff);
}

.result.lose {
  border-color: rgb(215 0 21 / 34%);
  background: linear-gradient(135deg, #fff1f2, #ffffff);
}

.settlement {
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  padding: 18px;
  text-align: right;
}

.settlement span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.settlement strong {
  color: var(--brand);
  font-size: 42px;
}

.history {
  display: grid;
  gap: 18px;
  margin-top: 20px;
  border-radius: 30px;
  padding: 24px;
}

.history h2 {
  font-size: 30px;
}

.history ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history li,
.empty-history {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-soft);
  padding: 14px 16px;
}

.history li {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 12px;
  align-items: center;
}

.history li > span,
.history small {
  color: var(--muted);
  font-weight: 700;
}

.error {
  margin-top: 16px;
  border-radius: 18px;
  background: #fff1f2;
  padding: 14px 16px;
  color: var(--red);
  font-weight: 800;
}

@media (max-width: 900px) {
  #app {
    width: min(100% - 20px, 1160px);
    padding: 12px 0;
  }

  .hero,
  .result {
    align-items: stretch;
    flex-direction: column;
  }

  .play {
    grid-template-columns: 1fr;
  }

  .prompt {
    min-height: 0;
    padding: 24px;
  }

  .options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history li {
    grid-template-columns: 1fr;
  }

  .settlement {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .meta,
  .options {
    grid-template-columns: 1fr;
  }

  .hero,
  .play,
  .result,
  .history {
    border-radius: 24px;
  }

  .prompt > strong {
    font-size: 48px;
  }
}

/* Mobile compact status strip */
@media (max-width: 560px) {
  .hero {
    min-height: 0;
    gap: 14px;
    padding: 20px;
  }

  .meta {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .meta span {
    min-height: 34px;
    display: flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 12px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
