* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: #f2f7ff; color: #1f2937; }
a { color: #2563eb; }
.topbar { background: #111827; color: #fff; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.brand { color: #fff; font-weight: 700; font-size: 20px; text-decoration: none; }
.topnav { display: flex; gap: 12px; flex-wrap: wrap; }
.topnav a { color: #d1d5db; text-decoration: none; }
.topnav a:hover { color: #fff; }
.userchip { display: flex; gap: 10px; align-items: center; }
.coins { background: #f59e0b; color: #111827; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.demo-notice { background: #fef3c7; color: #92400e; text-align: center; padding: 8px; font-size: 14px; }
.main { max-width: 720px; margin: 0 auto; padding: 14px; }
.card { background: #fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.08); padding: 18px; margin-bottom: 16px; }
.card.narrow { max-width: 480px; margin: 0 auto 16px; }
h2 { margin-top: 0; }
.muted { color: #6b7280; }
.msg { background: #d1fae5; color: #065f46; padding: 10px; border-radius: 8px; margin: 10px 0; }
.err { background: #fee2e2; color: #991b1b; padding: 10px; border-radius: 8px; margin: 10px 0; }
.hidden { display: none; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 600; }
.form-group input, .form-row input, .inline-form input { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 16px; }
.form-row { display: flex; gap: 8px; margin-top: 12px; }
.form-row input { flex: 1; }
.inline-form { display: inline; }
.inline-form input { width: 110px; padding: 6px; font-size: 14px; }
.btn { background: #2563eb; color: #fff; border: 0; padding: 10px 18px; border-radius: 8px; font-size: 16px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-sec { background: #fff; color: #2563eb; border: 1px solid #2563eb; }
.btn-danger { background: #dc2626; }
.btn-small { padding: 6px 12px; font-size: 14px; }
.twrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid #e5e7eb; padding: 8px; text-align: left; }
th { background: #eef2f7; }
.players-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 8px; }
.players-bar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players-bar > span:nth-child(2) { flex-shrink: 0; overflow: visible; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.dot-red { background: #dc2626; }
.dot-yellow { background: #eab308; }
.turn-info { font-weight: 700; margin-bottom: 4px; }
.board { display: grid; grid-template-columns: repeat(15, 1fr); width: min(94vw, 520px); margin: 10px auto; border: 2px solid #111827; background: #fff; }
.cell { aspect-ratio: 1; border: 1px solid #d1d5db; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-wrap: wrap; }
.cell.base-red { background: #dc2626; }
.cell.base-yellow { background: #eab308; }
.cell.base-green { background: #16a34a; }
.cell.base-blue { background: #2563eb; }
.cell.base-inner { background: #fff; }
.cell.base-spot { background: #fff; border-color: transparent; border-radius: 50%; }
.cell.spot-red { box-shadow: inset 0 0 0 3px #dc2626; }
.cell.spot-yellow { box-shadow: inset 0 0 0 3px #eab308; }
.cell.spot-green { box-shadow: inset 0 0 0 3px #16a34a; }
.cell.spot-blue { box-shadow: inset 0 0 0 3px #2563eb; }
.cell.center-green { background: #16a34a; }
.cell.center-red { background: #dc2626; }
.cell.center-yellow { background: #eab308; }
.cell.center-blue { background: #2563eb; }
.cell.center-corner-tl { background: linear-gradient(to top right, #dc2626 50%, #16a34a 50%); }
.cell.center-corner-tr { background: linear-gradient(to bottom right, #16a34a 50%, #eab308 50%); }
.cell.center-corner-bl { background: linear-gradient(to bottom right, #dc2626 50%, #2563eb 50%); }
.cell.center-corner-br { background: linear-gradient(to top right, #2563eb 50%, #eab308 50%); }
.cell.center-mid { background: #fff; }
.cell.home-red { background: #fca5a5; }
.cell.home-yellow { background: #fcd34d; }
.cell.home-green { background: #86efac; }
.cell.home-blue { background: #93c5fd; }
.cell.track { background: #fff; }
.cell.start-red { background: #ef4444; color: #fff; }
.cell.start-yellow { background: #f59e0b; }
.cell.star { color: #d97706; font-size: 13px; }
.cell.empty { background: #f8fafc; border-color: #f1f5f9; }
.tok { width: 72%; aspect-ratio: 1; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.tok-red { background: #dc2626; }
.tok-yellow { background: #eab308; }
.tok.movable { outline: 3px dashed #2563eb; outline-offset: 1px; cursor: pointer; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.15); } }
.dice-row { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 12px 0; }
.dice { font-size: 56px; line-height: 1; }
.log { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px; font-size: 14px; }
.log div { padding: 2px 0; }
