* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center; font-family: "Trebuchet MS", system-ui, sans-serif; background: linear-gradient(135deg, #ff9a8b, #ffd36e 45%, #7be0c3); color: #2a2340; padding: 1rem; }
.card { background: #fffdf7; border-radius: 24px; padding: 2rem; width: 100%; max-width: 26rem; text-align: center; box-shadow: 0 10px 0 rgba(42, 35, 64, .15); border: 3px solid #2a2340; }
h1 { margin: 0 0 .25rem; font-size: 2.2rem; color: #e8436d; }
h1 .wiggle { display: inline-block; animation: wiggle 2.5s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; text-align: left; }
.sub { color: #6b5f85; margin: .25rem 0 1rem; }
form { margin-bottom: 1.25rem; }
small { display: block; color: #8a7fa3; margin-top: .35rem; }
.btn { display: block; width: 100%; padding: .9rem; border: 3px solid #2a2340; border-radius: 14px; background: #fff; color: #2a2340; font-size: 1.1rem; font-weight: 700; cursor: pointer; text-decoration: none; box-shadow: 0 4px 0 #2a2340; transition: transform .1s, box-shadow .1s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #2a2340; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #2a2340; }
.btn.primary { background: #ff6f91; color: #fff; }
.btn.accent { background: #3fc9a0; color: #fff; }
.pin { width: 100%; padding: .9rem; margin-bottom: .6rem; font-size: 1.3rem; text-align: center; letter-spacing: .2em; text-transform: uppercase; border: 3px solid #2a2340; border-radius: 14px; background: #fff7d6; }
.error { background: #ffe1e6; color: #a1163a; padding: .6rem; border-radius: 10px; }
.code { font-size: 3rem; font-weight: 800; letter-spacing: .25em; padding: .5rem 0 .5rem .25em; background: #ffe9a8; border: 3px dashed #e8436d; border-radius: 14px; }
.players { list-style: none; padding: 0; margin: 0 0 1rem; text-align: left; }
.players li { padding: .5rem .75rem; border-bottom: 2px dotted #e6dcc3; }
.avatars { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: 1rem; }
.avatar input { position: absolute; opacity: 0; }
.avatar span { display: block; font-size: 2rem; padding: .4rem; border: 3px solid #e6dcc3; border-radius: 14px; background: #fff; cursor: pointer; }
.avatar input:checked + span { border-color: #e8436d; background: #ffe1e6; }
.avatar.taken span { opacity: .3; filter: grayscale(1); cursor: not-allowed; }
.avatar input:focus-visible + span { outline: 3px solid #2a2340; }
.pin.name { text-transform: none; letter-spacing: normal; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
#snake { width: 100%; max-width: 300px; touch-action: none; border: 3px solid #2a2340; border-radius: 10px; background: #fff7d6; }
.players li.npc { color: #8a7fa3; font-style: italic; }
body.secret-screen { background: radial-gradient(circle at 50% 40%, #ff4d4d, #d00000 55%, #6e0010) !important; animation: red-pulse 3s ease-in-out infinite alternate; min-height: 100vh; margin: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; box-sizing: border-box; }
@keyframes red-pulse { from { filter: brightness(1); } to { filter: brightness(1.18); } }
body.secret-screen p { text-shadow: 0 3px 0 rgba(110, 0, 16, .6), 0 0 24px rgba(255, 200, 200, .5); color: #fff; font-size: 2.2rem; font-weight: bold; margin: 0; }
body.secret-screen .dice-wait { font-size: 1.2rem; font-weight: normal; margin-top: 24px; }
body.secret-screen .dice { font-size: 7rem; line-height: 1; color: #fff; margin-top: 16px; }
body.secret-screen .dice.rolling { animation: dice-spin 0.3s linear infinite; }
body.secret-screen .dice-role { margin-top: 16px; }
body.secret-screen .dice-info { margin: 12px auto 0; max-width: 360px; font-size: 1rem; font-weight: 400; }
body.secret-screen [hidden] { display: none; }
@keyframes dice-spin { to { transform: rotate(360deg); } }
.tasks { text-align: left; padding-left: 1.4rem; }
.tasks li { margin-bottom: .9rem; }
.solo-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.solo-tabs .btn { font-size: .95rem; padding: .6rem; }
.r-box { display: block; width: 100%; height: 160px; border: 3px solid #2a2340; border-radius: 14px; background: #fff; font-size: 1.2rem; font-weight: 700; cursor: pointer; }
.r-box.wait { background: #ff8a80; }
.r-box.go { background: #3fc9a0; color: #fff; }
.s-q { font-size: 2.5rem; font-weight: 800; margin: .5rem 0; }
.solo-game[hidden] { display: none; }
.palette { display: flex; gap: 6px; justify-content: center; margin: 8px 0; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #888; cursor: pointer; }
.swatch.on { border: 4px solid #000; }
.coloring { width: 100%; max-width: 420px; background: #fff; border: 2px solid #333; border-radius: 8px; }
.coloring .fillable { stroke: #333; stroke-width: 2; cursor: pointer; }
.m-field { position: relative; width: 100%; height: 280px; margin: 8px 0; background: #fff3e0; border-radius: 8px; overflow: hidden; }
.marsh { position: absolute; font-size: 2.4rem; background: none; border: 0; cursor: pointer; padding: 4px; }
