/* Cryst Coin Hunt */
:root { --gold: #ffd56a; --ink: #120d3a; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0a2a; color: #fff6dc; font: 800 16px/1.3 Nunito, system-ui, sans-serif; touch-action: none; user-select: none; -webkit-user-select: none; }
#cv { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
button { font: inherit; cursor: pointer; }
.scr { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 20px; text-align: center;
  background: radial-gradient(70% 60% at 50% 35%, rgba(255, 200, 90, .22), transparent 70%), radial-gradient(90% 70% at 50% 100%, rgba(122, 92, 255, .4), transparent 70%), linear-gradient(#120d3a, #1d1450 55%, #0b0a2a); }
.scr[hidden] { display: none; }
.scr h1 { margin: 0; font: 900 clamp(28px, 5vw, 46px)/1.05 Cinzel, Georgia, serif; background: linear-gradient(100deg, #fff6d6, #ffd56a 35%, #fff 50%, #ffd56a 65%, #fff6d6) 0 0 / 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 rgba(80, 40, 0, .7)) drop-shadow(0 0 16px rgba(255, 200, 90, .45)); animation: shine 6s linear infinite; }
@keyframes shine { to { background-position: -220% 0; } }
#sTitle { justify-content: flex-end; padding-bottom: clamp(24px, 6vh, 60px); }
.tbg { position: absolute; inset: 0; background: #120d3a center 35% / cover no-repeat; animation: kb 26s ease-in-out infinite alternate; }
.tbg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(10, 6, 40, .35), rgba(10, 6, 40, 0) 30%, rgba(10, 6, 40, 0) 55%, rgba(10, 6, 40, .75)); }
@keyframes kb { from { transform: scale(1.03); } to { transform: scale(1.12) translateY(-1.5%); } }
.logo { position: absolute; top: clamp(14px, 4vh, 40px); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.logo b, .logo span { font: 900 clamp(38px, 8vw, 92px)/.95 Cinzel, Georgia, serif; letter-spacing: .03em; background: linear-gradient(180deg, #fff8dc, #ffd56a 45%, #e59a24 75%, #ffe9a8); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #6b3e06) drop-shadow(0 0 26px rgba(255, 200, 90, .8)); }
.logo span { font-size: clamp(46px, 10vw, 118px); }
.logo em { margin-top: 6px; padding: 6px 20px; border-radius: 999px; font: 900 clamp(15px, 2.4vw, 22px) Fredoka, Nunito, sans-serif; font-style: normal; color: #fff; background: linear-gradient(#6a2bd9, #3b148f); border: 3px solid var(--gold); box-shadow: 0 0 24px rgba(160, 110, 255, .7); }
.go { position: relative; z-index: 2; padding: 13px 28px; border: 0; border-radius: 999px; color: #2a1600; font-weight: 900; font-size: 19px; background: linear-gradient(#fff2b8, #ffd56a 45%, #f0a92e); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55), 0 0 26px rgba(255, 200, 90, .7), 0 8px 18px rgba(0, 0, 0, .35); }
.go.big { font-size: clamp(20px, 3vw, 28px); padding: 16px 40px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.go:disabled { filter: grayscale(.7) brightness(.8); animation: none; }
.back { position: absolute; left: 16px; top: 16px; z-index: 3; padding: 9px 16px; border-radius: 999px; border: 2px solid rgba(255, 214, 120, .7); background: rgba(16, 10, 44, .85); color: #fff3c4; font-weight: 900; }
.back.inl { position: static; }
.lobby { position: absolute; left: 16px; top: 16px; z-index: 3; padding: 8px 14px; border-radius: 999px; background: rgba(16, 10, 44, .8); border: 2px solid var(--gold); color: #fff3c4; text-decoration: none; font-weight: 900; }
.heroes { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(10px, 2vw, 24px); }
.hero { width: clamp(150px, 26vw, 250px); padding: 12px 12px 14px; border-radius: 22px; border: 3px solid rgba(255, 214, 120, .6); background: linear-gradient(180deg, rgba(60, 40, 130, .9), rgba(20, 12, 50, .95)); color: #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); transition: transform .2s, box-shadow .2s; }
.hero:hover, .hero.on { transform: translateY(-6px) scale(1.03); box-shadow: 0 0 34px rgba(255, 200, 90, .7); border-color: var(--gold); }
.hero canvas, .hero img { width: 100%; height: clamp(150px, 26vw, 250px); object-fit: contain; display: block; }
.hero b { display: block; margin-top: 6px; font: 900 24px Fredoka, Nunito, sans-serif; color: var(--gold); }
.hero small { color: #cfc6ef; font-size: 13px; }
.modes { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.mode { width: clamp(160px, 26vw, 240px); padding: 18px 14px; border-radius: 20px; border: 3px solid rgba(255, 214, 120, .6); background: linear-gradient(180deg, rgba(60, 40, 130, .9), rgba(20, 12, 50, .95)); color: #fff; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.mode span { font-size: 44px; } .mode b { font: 900 21px Fredoka, Nunito, sans-serif; color: var(--gold); } .mode small { color: #cfc6ef; font-size: 13.5px; }
.mode:hover { border-color: var(--gold); box-shadow: 0 0 26px rgba(255, 200, 90, .6); }
.join { display: flex; gap: 10px; }
.join input { width: 180px; padding: 12px 16px; border-radius: 16px; border: 3px solid var(--gold); background: rgba(255, 255, 255, .1); color: #fff; font: 900 30px/1 Fredoka, Nunito, sans-serif; letter-spacing: .3em; text-align: center; text-transform: uppercase; }
.msg { margin: 0; color: #cfc6ef; max-width: 520px; } .msg.bad { color: #ffb0b0; }
.code { font: 900 clamp(56px, 12vw, 110px)/1 Fredoka, Nunito, sans-serif; letter-spacing: .18em; color: #fff; text-shadow: 0 0 30px rgba(255, 200, 90, .8), 0 4px 0 #6b3e06; }
.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.plist li { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 2px solid rgba(255, 214, 120, .45); }
.plist i { width: 30px; height: 30px; border-radius: 50%; display: inline-block; border: 2px solid #fff; }
#hud { position: fixed; left: 0; right: 0; top: 0; z-index: 10; display: flex; gap: 8px; align-items: flex-start; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px; pointer-events: none; }
#hud[hidden] { display: none; }
.pill { padding: 8px 16px; border-radius: 999px; background: rgba(16, 10, 44, .85); border: 2px solid var(--gold); font: 900 20px/1 Fredoka, Nunito, sans-serif; display: flex; align-items: center; gap: 6px; box-shadow: 0 6px 14px rgba(0, 0, 0, .3); }
.pill.coin img { width: 28px; height: 28px; margin: -4px 0; } .pill.coin b { font-size: 24px; }
.pill.hurry { color: #ffb0b0; border-color: #ff8080; animation: pulse 1s infinite; }
#hLeft { font-size: 15px; }
#hBoard { margin: 0 0 0 auto; padding: 8px 12px 8px 30px; border-radius: 16px; background: rgba(16, 10, 44, .85); border: 2px solid rgba(255, 214, 120, .6); font-size: 14px; line-height: 1.5; min-width: 150px; }
#hBoard li.me { color: var(--gold); }
#hud .tbtn { pointer-events: auto; margin-left: auto; }
#hBoard:not([hidden]) + .tbtn { margin-left: 0; }
.tbtn { padding: 8px 14px; border-radius: 999px; border: 2px solid var(--gold); background: rgba(16, 10, 44, .85); color: #fff3c4; font-weight: 900; }
#sound { position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 30; }
#joy { position: fixed; left: 22px; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 11; width: 130px; height: 130px; border-radius: 50%; background: rgba(255, 255, 255, .12); border: 3px solid rgba(255, 214, 120, .6); }
#joy i { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8dc, #ffd56a 60%, #d48a1c); box-shadow: 0 4px 10px rgba(0, 0, 0, .35); }
#toast { position: fixed; left: 50%; bottom: 70px; z-index: 15; transform: translateX(-50%); padding: 10px 22px; border-radius: 999px; background: rgba(16, 10, 44, .92); border: 2px solid var(--gold); font: 900 19px Fredoka, Nunito, sans-serif; opacity: 0; transition: opacity .3s; pointer-events: none; white-space: nowrap; }
#toast.on { opacity: 1; }
.count { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; font: 900 clamp(90px, 20vw, 200px)/1 Fredoka, Nunito, sans-serif; color: #fff; text-shadow: 0 0 40px rgba(255, 200, 90, .9), 0 6px 0 #6b3e06; pointer-events: none; }
.count[hidden] { display: none; }
.card { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: rgba(8, 6, 26, .78); }
.card[hidden] { display: none; }
.card h2 { margin: 0; font: 900 40px Cinzel, Georgia, serif; color: var(--gold); }
.row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.podium { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; min-width: min(420px, 90vw); }
.podium li { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 16px; background: rgba(255, 255, 255, .08); border: 2px solid rgba(255, 214, 120, .45); font-size: 19px; }
.podium li:first-child { border-color: var(--gold); box-shadow: 0 0 24px rgba(255, 200, 90, .55); }
.podium li b { margin-left: auto; color: var(--gold); font-size: 24px; }
.podium i { width: 28px; height: 28px; border-radius: 50%; display: inline-block; border: 2px solid #fff; }
.verse { margin: 0; max-width: 560px; color: #efe7ff; font-style: italic; } .verse b { display: block; font-style: normal; color: var(--gold); font-size: 14px; }
#rot { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(5, 4, 20, .9); text-align: center; }
#rot[hidden] { display: none; } #rot button { margin-top: 10px; padding: 8px 20px; border-radius: 999px; border: 0; background: var(--gold); font-weight: 900; }
