/* ============ Putt Party 1.1 ============ */
@font-face { font-family: 'Rubik'; src: url('fonts/rubik-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Rubik'; src: url('fonts/rubik-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Rubik'; src: url('fonts/rubik-900.woff2') format('woff2'); font-weight: 900; font-display: swap; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'Rubik', system-ui, -apple-system, sans-serif;
  color: #eef2ff;
  background: #090c1c;
  -webkit-user-select: none; user-select: none;
  touch-action: none;
}
input { -webkit-user-select: text; user-select: text; }

/* ---------- background ---------- */
#bg { position: fixed; inset: 0; z-index: 0; background:
  linear-gradient(180deg, rgba(9,12,28,.62), rgba(9,12,28,.38) 45%, rgba(9,12,28,.72)),
  url('textures/bg-menu.jpg') center / cover no-repeat,
  #090c1c; }
.blob { display: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; animation: drift 26s ease-in-out infinite alternate; }
.b1 { width: 44vw; height: 44vw; background: #2b3a8a55; left: -10vw; top: -12vw; }
.b2 { width: 36vw; height: 36vw; background: #6a2b8a44; right: -8vw; top: 20vh; animation-delay: -8s; }
.b3 { width: 40vw; height: 40vw; background: #1d7a6a3d; left: 24vw; bottom: -18vw; animation-delay: -16s; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(6vw, -4vh) scale(1.15); } }
.vig { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0,0,0,.5)); }
#bg-tint { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease, background 1.6s ease; }
#bg-tint.on { opacity: 1; }

/* ---------- shared ---------- */
.screen { position: fixed; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; overflow: auto; }
.hidden { display: none !important; }
:root {
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
}
.glass {
  background: var(--noise), linear-gradient(160deg, rgba(255,255,255,.10), rgba(255,255,255,.045));
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.14), inset 0 -1px 0 rgba(0,0,0,.25);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.glass-mini {
  background: var(--noise), linear-gradient(165deg, rgba(24,30,58,.78), rgba(10,13,28,.78));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.10);
}
.dim { opacity: .55; font-weight: 400; font-size: .85em; }

.btn {
  font: 700 15px Rubik, sans-serif; color: #eef2ff;
  background: none;
  border: 12px solid transparent;
  border-image: url('img/ui/btn-dark.png') 24 fill / 12px stretch;
  padding: 3px 10px; cursor: pointer; position: relative;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.35));
  transition: transform .12s, filter .15s;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.btn:hover { transform: translateY(-2px); filter: drop-shadow(0 8px 18px rgba(0,0,0,.45)) brightness(1.14); }
.btn:active {
  transform: translateY(2px);
  border-image: url('img/ui/btn-dark-press.png') 24 fill / 12px stretch;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.4));
}
.btn.primary {
  border-image: url('img/ui/btn-green.png') 24 fill / 12px stretch;
  color: #06341f; text-shadow: 0 1px 0 rgba(255,255,255,.25);
}
.btn.primary:active { border-image: url('img/ui/btn-green-press.png') 24 fill / 12px stretch; }
.btn.big { font-size: 19px; padding: 8px 16px; width: 100%; }
.btn.small { font-size: 13px; padding: 0 6px; border-width: 10px; border-image-width: 10px; }
.btn.danger { border-image: url('img/ui/btn-red.png') 24 fill / 12px stretch; }
.btn.danger:active { border-image: url('img/ui/btn-red.png') 24 fill / 12px stretch; }
.btn:disabled { opacity: .45; cursor: default; transform: none !important; filter: grayscale(.35); }
.mini-btn {
  font-size: 14px; padding: 6px 10px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); color: #fff;
  transition: background .15s;
}
.mini-btn:hover { background: rgba(255,255,255,.22); }

.fld { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.fld > span { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .6; }
input {
  font: 700 16px Rubik, sans-serif; color: #fff;
  background: rgba(0,0,0,.3); border: 1.5px solid rgba(255,255,255,.16);
  border-radius: 12px; padding: 12px 14px; outline: none;
  transition: border-color .15s;
}
input:focus { border-color: #3ddc84; }

.seg { display: flex; background: rgba(0,0,0,.3); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button {
  flex: 1; font: 700 14px Rubik, sans-serif; color: #cfd6ff; background: transparent;
  border: 0; padding: 9px 8px; border-radius: 9px; cursor: pointer; transition: background .15s;
}
.seg button.on { background: linear-gradient(135deg, #3ddc84, #19b8a6); color: #052b1b; }
.seg button:not(.on):hover { background: rgba(255,255,255,.08); }

.tog { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; margin-bottom: 12px; cursor: pointer; }
.tog em { font-style: normal; }
.pcard .crown .icn { width: 18px; height: 18px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.tog input { display: none; }
.tog span {
  width: 44px; height: 24px; border-radius: 13px; background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.18); position: relative; transition: background .18s; flex-shrink: 0;
}
.tog span::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px; transition: left .18s;
}
.tog input:checked + span { background: #19b8a6; }
.tog input:checked + span::after { left: 22px; }

/* ---------- menu ---------- */
.menu-wrap { text-align: center; padding: 20px; max-width: 520px; width: 100%; }
.logo { position: relative; display: inline-block; margin-bottom: 6px; }
.logo h1 {
  font-size: clamp(44px, 9vw, 84px); font-weight: 900; letter-spacing: .02em;
  background: linear-gradient(135deg, #7cffb2 10%, #40c4ff 55%, #c471ed 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 30px rgba(64,196,255,.35));
}
.ver {
  position: absolute; top: -6px; right: -34px;
  background: linear-gradient(135deg, #ffd23f, #ff8c42); color: #3a2200;
  font-weight: 900; font-size: 18px; padding: 4px 12px; border-radius: 999px;
  transform: rotate(12deg); box-shadow: 0 6px 20px #ff8c4266;
}
.logo-ball { position: absolute; left: -64px; top: -18px; animation: bounce 2.2s ease-in-out infinite; font-size: 44px; }
@keyframes bounce { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-16px) } }
.tagline { opacity: .7; margin-bottom: 22px; font-size: 15px; }
.menu-card { padding: 26px; text-align: left; }
.emoji-row { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-row button {
  font-size: 22px; width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
  background: rgba(0,0,0,.25); border: 2px solid transparent; transition: transform .12s, border-color .12s;
}
.emoji-row button:hover { transform: scale(1.15); }
.emoji-row button.on { border-color: #3ddc84; background: rgba(61,220,132,.15); }
.row-2 { display: flex; gap: 10px; margin-top: 10px; }
.row-2 > .btn { flex: 1; }
.join-row { flex: 1; display: flex; gap: 6px; }
.join-row input { width: 84px; text-align: center; text-transform: uppercase; letter-spacing: .2em; padding: 10px 8px; }
.join-row .btn { flex: 1; }
.foot { margin-top: 18px; font-size: 12.5px; opacity: .45; }
#btn-quick { margin-bottom: 4px; }

/* ---------- lobby ---------- */
.lobby-wrap { width: min(1060px, 96vw); padding: 18px; }
.lobby-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; margin-bottom: 16px; }
.lobby-head h2 { font-size: 26px; font-weight: 900; }
.room-code { font-size: 14px; opacity: .8; margin-top: 3px; }
.room-code b { font-size: 19px; letter-spacing: .25em; color: #7cffb2; margin: 0 4px; }
.lobby-head-right { display: flex; gap: 8px; }
.lobby-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
@media (max-width: 860px) { .lobby-cols { grid-template-columns: 1fr; } }
.lobby-players, .lobby-settings { padding: 20px 22px; }
.lobby-players h3, .lobby-settings h3 { margin-bottom: 14px; font-size: 17px; }
.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.pcard {
  background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px; padding: 12px 8px; text-align: center; position: relative;
  animation: pop .25s ease;
}
@keyframes pop { from { transform: scale(.7); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.pcard .pball {
  width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center; font-size: 21px;
  box-shadow: inset -5px -6px 10px rgba(0,0,0,.4), inset 4px 5px 8px rgba(255,255,255,.35), 0 5px 12px rgba(0,0,0,.4);
}
.pcard .pname { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .crown { position: absolute; top: -9px; left: 50%; transform: translateX(-50%) rotate(-14deg); font-size: 17px; }
.pcard.empty { opacity: .3; border-style: dashed; }
.pcard.off { opacity: .45; }
.spec-row { margin-top: 12px; font-size: 13px; opacity: .65; }
.bot-row { display: flex; align-items: center; gap: 14px; font-weight: 900; font-size: 18px; }
#btn-start { margin-top: 6px; }
.sets-strip { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; opacity: .75; }
.sets-strip div b { color: #7cffb2; }

/* ---------- vote ---------- */
.vote-wrap { text-align: center; width: min(1100px, 96vw); padding: 20px; }
.vote-wrap h2 { font-size: 30px; font-weight: 900; margin-bottom: 14px; }
.vote-timer { height: 7px; background: rgba(255,255,255,.12); border-radius: 4px; margin: 0 auto 22px; max-width: 420px; overflow: hidden; }
#vote-bar { height: 100%; width: 100%; background: linear-gradient(90deg, #3ddc84, #40c4ff); border-radius: 4px; transition: width .5s linear; }
.vote-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.vcard {
  border-radius: 20px; padding: 22px 16px 18px; cursor: pointer; position: relative;
  border: 2px solid rgba(255,255,255,.14);
  transition: transform .15s, border-color .15s, box-shadow .15s;
  overflow: hidden;
}
.vcard:hover { transform: translateY(-5px) scale(1.02); }
.vcard.on { border-color: #7cffb2; box-shadow: 0 0 0 3px #7cffb244, 0 18px 44px rgba(0,0,0,.5); }
.vcard .vem { font-size: 44px; margin-bottom: 8px; }
.vcard h3 { font-size: 19px; font-weight: 900; }
.vcard .vset { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .75; margin: 3px 0 8px; }
.vcard p { font-size: 12.5px; opacity: .82; min-height: 34px; }
.vcard .vcount {
  position: absolute; top: 10px; right: 10px; min-width: 26px; height: 26px; border-radius: 13px;
  background: rgba(0,0,0,.45); font-weight: 900; font-size: 14px;
  display: flex; align-items: center; justify-content: center; padding: 0 7px;
}

/* ---------- game ---------- */
#scr-game { display: block; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
#hud { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
#hud > * { pointer-events: auto; }
#hud-top {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  padding: 9px 20px; font-weight: 700; font-size: 15px; white-space: nowrap;
  display: flex; gap: 10px; align-items: center;
}
.hud-sep { opacity: .3; }
#hud-timer.low { color: #ff5252; animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .45 } }
#hud-board {
  position: absolute; top: 12px; right: 12px; padding: 10px 14px;
  font-size: 13px; min-width: 190px;
}
.brow { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.brow .bdot { width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0; box-shadow: inset -2px -2px 3px rgba(0,0,0,.4); }
.brow .bname { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.brow .bstr { opacity: .8; min-width: 20px; text-align: right; }
.brow .btot { opacity: .5; min-width: 30px; text-align: right; }
.brow.me .bname { color: #7cffb2; }
.brow.sunk .bstr { color: #3ddc84; }
#hud-slots {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 12px;
}
.slot {
  width: 74px; height: 74px; border-radius: 18px; cursor: pointer; position: relative;
  background: rgba(12,16,36,.75); border: 1.5px solid rgba(255,255,255,.16);
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: transform .12s, border-color .12s; text-align: center;
}
.slot:hover { transform: translateY(-4px); border-color: #7cffb2; }
.slot .sem { font-size: 30px; line-height: 1; }
.slot .snm { font-size: 8.5px; font-weight: 700; opacity: .8; margin-top: 4px; padding: 0 3px; }
.slot .skey {
  position: absolute; top: -7px; left: -7px; width: 20px; height: 20px; border-radius: 7px;
  background: #3ddc84; color: #052b1b; font-size: 12px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.slot.empty { opacity: .32; cursor: default; border-style: dashed; }
.slot.empty:hover { transform: none; border-color: rgba(255,255,255,.16); }
@keyframes slotIn { from { transform: scale(.4) rotate(-14deg); } to { transform: scale(1) rotate(0); } }
.slot.new { animation: slotIn .3s cubic-bezier(.2,1.6,.4,1); }
#hud-target {
  position: absolute; bottom: 108px; left: 50%; transform: translateX(-50%);
  background: rgba(12,16,36,.85); padding: 10px 16px; border-radius: 12px;
  border: 1px solid #ffd23f88; font-weight: 700; font-size: 14px;
  display: flex; gap: 12px; align-items: center;
}
#hud-spectate { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); padding: 10px 18px; font-weight: 700; }
.hud-corner { position: absolute; bottom: 14px; right: 14px; display: flex; gap: 6px; }
#chatbox { position: absolute; bottom: 14px; left: 14px; width: 250px; }
#chat-msgs { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; max-height: 180px; overflow: hidden; }
.cmsg {
  background: rgba(12,16,36,.72); border-radius: 10px; padding: 5px 10px; font-size: 12.5px;
  animation: pop .2s ease; opacity: 1; transition: opacity 1s;
  border: 1px solid rgba(255,255,255,.08); width: fit-content; max-width: 100%;
  overflow-wrap: break-word;
}
.cmsg.fade { opacity: 0; }
.cmsg b { margin-right: 5px; }
#chat-inp { width: 100%; font-size: 13px; padding: 8px 12px; opacity: .45; transition: opacity .15s; }
#chat-inp:focus { opacity: 1; }

/* intro + go */
.overlay {
  position: fixed; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center;
  background: rgba(5,7,18,.55); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  animation: fadein .25s ease;
}
@keyframes fadein { from { opacity: 0 } to { opacity: 1 } }
#ov-intro { background: transparent; pointer-events: none; z-index: 5; }
.intro-card { padding: 30px 60px; text-align: center; animation: introIn .5s cubic-bezier(.2,1.4,.3,1); }
@keyframes introIn { from { transform: translateY(50px) scale(.8); opacity: 0 } to { transform: none; opacity: 1 } }
.intro-card .iem { font-size: 52px; }
.intro-card h2 { font-size: 34px; font-weight: 900; margin: 6px 0 2px; }
.intro-card p { opacity: .75; font-weight: 700; }
#ov-go {
  position: fixed; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center;
  font-size: clamp(70px, 16vw, 160px); font-weight: 900; pointer-events: none;
  background: transparent;
  color: #7cffb2; text-shadow: 0 10px 60px #3ddc8488;
  animation: goAnim .8s cubic-bezier(.2,1.4,.3,1) forwards;
}
@keyframes goAnim { 0% { transform: scale(.3); opacity: 0 } 30% { transform: scale(1.15); opacity: 1 } 70% { transform: scale(1); opacity: 1 } 100% { transform: scale(1.6); opacity: 0 } }

/* results — hole-end overlay is "lite" so the winning-putt replay shows behind it */
#ov-holeend { background: rgba(5,7,18,.28); backdrop-filter: none; -webkit-backdrop-filter: none; align-items: flex-start; }
#ov-holeend .result-card { margin-top: 56px; transform: scale(.94); }
.result-card { padding: 28px 34px; min-width: min(560px, 92vw); max-height: 86vh; overflow: auto; }
.result-card h2 { font-size: 26px; font-weight: 900; margin-bottom: 16px; text-align: center; }
.rrow {
  display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: 14px;
  background: rgba(0,0,0,.25); margin-bottom: 7px; animation: rowIn .4s ease backwards;
}
.rrow:nth-child(2) { animation-delay: .08s } .rrow:nth-child(3) { animation-delay: .16s }
.rrow:nth-child(4) { animation-delay: .24s } .rrow:nth-child(5) { animation-delay: .32s }
.rrow:nth-child(6) { animation-delay: .4s } .rrow:nth-child(7) { animation-delay: .48s }
.rrow:nth-child(8) { animation-delay: .56s }
@keyframes rowIn { from { transform: translateX(-30px); opacity: 0 } to { transform: none; opacity: 1 } }
.rrow .rmedal { font-size: 20px; width: 28px; text-align: center; }
.rrow .rdot { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset -2px -3px 4px rgba(0,0,0,.4); }
.rrow .rname { flex: 1; font-weight: 700; }
.rrow .rlabel { font-size: 12px; font-weight: 700; opacity: .8; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.1); }
.rrow .rlabel.good { background: #3ddc8433; color: #7cffb2; }
.rrow .rlabel.bad { background: #ff525233; color: #ff9e9e; }
.rrow .rscore { font-weight: 900; font-size: 19px; min-width: 30px; text-align: right; }
.rrow .rtotal { opacity: .55; font-size: 13px; min-width: 60px; text-align: right; }
#he-next, #ce-next { text-align: center; margin-top: 14px; }
#btn-endgame { margin: 12px auto 0; display: block; }

/* podium */
.podium-wrap { text-align: center; padding: 24px; width: min(760px, 95vw); }
.podium-wrap h1 { font-size: clamp(30px, 6vw, 46px); font-weight: 900; margin-bottom: 30px; }
.podium-blocks { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin-bottom: 26px; }
.pblock { flex: 1; max-width: 190px; animation: rise .7s cubic-bezier(.2,1.3,.4,1) backwards; }
.pblock .pb-ball {
  width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  box-shadow: inset -6px -8px 12px rgba(0,0,0,.45), inset 5px 6px 10px rgba(255,255,255,.35), 0 8px 22px rgba(0,0,0,.5);
}
.pblock .pb-name { font-weight: 900; margin-bottom: 3px; }
.pblock .pb-score { opacity: .7; font-size: 14px; margin-bottom: 10px; }
.pblock .pb-bar {
  border-radius: 14px 14px 0 0; display: flex; align-items: flex-start; justify-content: center;
  font-size: 38px; padding-top: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.06));
  border: 1px solid rgba(255,255,255,.2); border-bottom: 0;
}
.pblock.p1 { order: 2; } .pblock.p1 .pb-bar { height: 150px; background: linear-gradient(180deg, #ffd23f66, #ffd23f11); border-color: #ffd23f88; }
.pblock.p2 { order: 1; animation-delay: .15s; } .pblock.p2 .pb-bar { height: 105px; background: linear-gradient(180deg, #cfd8dc55, #cfd8dc11); }
.pblock.p3 { order: 3; animation-delay: .3s; } .pblock.p3 .pb-bar { height: 78px; background: linear-gradient(180deg, #ff8a6555, #ff8a6511); }
@keyframes rise { from { transform: translateY(120px); opacity: 0 } to { transform: none; opacity: 1 } }
#podium-rest { max-width: 420px; margin: 0 auto 8px; }
.podium-btns { max-width: 420px; margin: 18px auto 0; }

/* modals */
/* popup cards: Kenney sprite frame (9-slice) over the dark glass */
.modal-card, .result-card, .intro-card, .lvlup-card {
  border: 20px solid transparent !important;
  border-image: url('img/ui/panel-frame.png') 20 / 20px stretch !important;
  border-radius: 8px !important;
}
.lvlup-card, #ov-podium .result-card {
  border-image: url('img/ui/panel-frame-green.png') 20 / 20px stretch !important;
}
.modal-card { padding: 26px 30px; width: min(680px, 94vw); max-height: 84vh; overflow: auto; }
.modal-card h2 { margin-bottom: 16px; }
.modal-close { margin-top: 16px; width: 100%; }
.help-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.howto {
  grid-column: 1 / -1; background: rgba(61,220,132,.08); border: 1px solid rgba(61,220,132,.25);
  border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.55;
}
@media (max-width: 640px) { .help-list { grid-template-columns: 1fr; } }
.hitem { display: flex; gap: 10px; background: rgba(0,0,0,.25); padding: 9px 12px; border-radius: 12px; align-items: flex-start; }
.hitem .hem { font-size: 22px; }
.hitem b { font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.hitem p { font-size: 12px; opacity: .75; margin-top: 2px; }
.tagnew { background: linear-gradient(135deg, #ffd23f, #ff8c42); color: #3a2200; font-size: 9px; font-weight: 900; padding: 2px 6px; border-radius: 999px; }
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick-list button {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; cursor: pointer;
  background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.12); color: #fff; font: 700 15px Rubik, sans-serif;
  transition: background .12s, transform .12s;
}
.pick-list button:hover { background: rgba(255,255,255,.12); transform: translateX(4px); }
.pick-list .pdot { width: 18px; height: 18px; border-radius: 50%; }

/* toasts */
#toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(12,16,36,.88); border: 1px solid rgba(255,255,255,.16);
  padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 14.5px;
  animation: toastIn .3s cubic-bezier(.2,1.4,.4,1), fadeout .4s ease 2.6s forwards;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  backdrop-filter: blur(8px);
}
.toast.gold { border-color: #ffd23f99; box-shadow: 0 10px 34px #ffd23f33; }
@keyframes toastIn { from { transform: translateY(-24px) scale(.8); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes fadeout { to { opacity: 0; transform: translateY(-12px) } }

/* account */
#acct-row {
  display: flex; align-items: center; gap: 10px; margin: -6px 0 14px;
  font-size: 12.5px; opacity: .9; padding: 0 4px;
}
#acct-row b { color: #7cffb2; }
.auth-card { width: min(400px, 94vw); }
.auth-err { color: #ff9e9e; font-size: 13px; font-weight: 700; margin: -6px 0 10px; }
#btn-auth-go { margin-bottom: 8px; }

/* profile card */
.prof-card {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
  background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px; padding: 12px 14px;
}
.prof-lv {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, #3ddc84, #19b8a6); color: #052b1b;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.prof-lv b { font-size: 19px; line-height: 1; }
.prof-lv span { font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.prof-mid { flex: 1; min-width: 110px; }
.prof-xpbar { height: 8px; border-radius: 5px; background: rgba(0,0,0,.4); overflow: hidden; margin-bottom: 4px; }
#prof-xpfill { height: 100%; width: 0%; background: linear-gradient(90deg, #3ddc84, #40c4ff); border-radius: 5px; transition: width .5s ease; }
#prof-xptxt { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prof-coins { display: flex; align-items: center; gap: 4px; font-weight: 900; color: #ffd23f; }
.prof-coins .icn { width: 17px; height: 17px; }
.skin-row { display: flex; flex-wrap: wrap; gap: 6px; }
.skin-btn {
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer; padding: 2px;
  background: rgba(0,0,0,.25); border: 2.5px solid transparent; transition: transform .12s, border-color .12s;
  display: flex; align-items: center; justify-content: center;
}
.skin-btn:hover { transform: scale(1.12); }
.skin-btn.on { border-color: #3ddc84; }
.skin-btn canvas { border-radius: 50%; }
.pkick {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 8px;
  background: #ff5252; color: #fff; border: 0; cursor: pointer; font-size: 12px; font-weight: 900;
  opacity: 0; transition: opacity .15s;
}
.pcard:hover .pkick { opacity: 1; }
#stats-row { font-size: 11.5px; margin: -8px 0 14px; padding: 0 4px; }
.pcard .plv {
  position: absolute; top: 6px; right: 6px; min-width: 20px; height: 20px; border-radius: 8px;
  background: linear-gradient(135deg, #3ddc84, #19b8a6); color: #052b1b;
  font-size: 11px; font-weight: 900; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* rewards track */
.rw-list { display: flex; flex-direction: column; gap: 6px; }
.rw-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px;
  background: rgba(0,0,0,.25); opacity: .55;
}
.rw-row.got { opacity: 1; border: 1px solid rgba(61,220,132,.3); }
.rw-lvl { width: 40px; text-align: center; flex-shrink: 0; }
.rw-lvl b { font-size: 17px; display: block; line-height: 1; }
.rw-lvl span { font-size: 9px; opacity: .6; text-transform: uppercase; letter-spacing: .1em; }
.rw-prev { width: 40px; display: flex; justify-content: center; flex-shrink: 0; }
.rw-prev .icn { width: 26px; height: 26px; color: #ffd23f; }
.rw-body { flex: 1; font-size: 14px; }
.rw-state { width: 26px; text-align: center; color: #7cffb2; font-weight: 900; }
.rw-state .icn { width: 17px; height: 17px; color: #8a91b4; }

/* shop */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.shop-h { grid-column: 1 / -1; font-size: 15px; margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.shop-h .icn { width: 18px; height: 18px; color: #7cffb2; }
.shop-ds { font-size: 11px; opacity: .7; min-height: 26px; }
.trail-dot { border-radius: 50%; box-shadow: inset -3px -4px 6px rgba(0,0,0,.3); }
.up-ic { width: 52px; height: 52px; border-radius: 16px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; }
.up-ic .icn { width: 30px; height: 30px; color: #ffd23f; }
#btn-mull {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(140px); z-index: 4;
  border-color: #40c4ff88; font-weight: 700;
}
#btn-mull .icn { width: 15px; height: 15px; color: #40c4ff; }
.shop-card {
  background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.1); border-radius: 16px;
  padding: 14px 10px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.shop-card.owned { opacity: .6; }
.shop-card b { font-size: 14px; }
.shop-card .mini-btn { width: 100%; }
.shop-card .mini-btn .icn { width: 13px; height: 13px; color: #ffd23f; }
#shop-coins .icn { width: 14px; height: 14px; color: #ffd23f; }

/* level up */
#ov-levelup { background: rgba(5,7,18,.7); z-index: 28; }
.lvlup-card { text-align: center; animation: introIn .5s cubic-bezier(.2,1.4,.3,1); }
.lvlup-badge {
  width: 110px; height: 110px; border-radius: 34px; margin: 0 auto 18px;
  background: linear-gradient(135deg, #ffd23f, #ff8c42); color: #3a2200;
  font-size: 52px; font-weight: 900; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 16px 60px #ffd23f66; transform: rotate(-6deg);
}
.lvlup-card h1 { font-size: 42px; font-weight: 900; margin-bottom: 14px;
  background: linear-gradient(135deg, #ffd23f, #ff8c42); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lvlup-rw {
  display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700;
  background: rgba(0,0,0,.4); border-radius: 999px; padding: 8px 18px; margin: 6px auto; width: fit-content;
}
.lvlup-rw canvas { border-radius: 50%; }
.lvlup-rw .icn { width: 20px; height: 20px; color: #ffd23f; }

/* scorecard */
#hud-board { cursor: pointer; transition: transform .12s; }
#hud-board:hover { transform: translateY(1px); }
.bfoot {
  margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.12);
  font-size: 11px; font-weight: 700; opacity: .7; text-align: center;
}
#sc-table-wrap { overflow-x: auto; }
.sctable { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.sctable th, .sctable td { padding: 7px 9px; text-align: center; border-bottom: 1px solid rgba(255,255,255,.07); }
.sctable thead th { font-size: 12px; opacity: .65; }
.sctable .parrow td { font-size: 11.5px; opacity: .55; border-bottom: 2px solid rgba(255,255,255,.18); }
.sctable .scname { text-align: left; white-space: nowrap; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.sctable .scname .bdot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.sctable td.good { color: #7cffb2; font-weight: 900; }
.sctable td.bad { color: #ff9e9e; }
.sctable td.cur, .sctable th.cur { background: rgba(124,255,178,.09); }
.sctable .scsum { font-weight: 900; font-size: 15px; }

/* left column: minimap + effects */
#left-col { position: absolute; top: 12px; left: 12px; z-index: 3; display: flex; flex-direction: column; gap: 10px; width: 218px; }
#minimap { width: 218px; height: 150px; padding: 0; }
@media (max-width: 860px) { #left-col, #minimap { width: 150px; } #minimap { height: 104px; } }

/* active effects panel */
#fx-panel { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.fxrow { display: flex; align-items: center; gap: 9px; padding: 4px 6px; border-radius: 10px; background: rgba(255,255,255,.05); }
.fxrow .icn { width: 20px; height: 20px; flex-shrink: 0; }
.fxrow.buff { box-shadow: inset 3px 0 0 #3ddc84; }
.fxrow.buff .icn { color: #7cffb2; }
.fxrow.debuff { box-shadow: inset 3px 0 0 #ff9e40; }
.fxrow.debuff .icn { color: #ffb46b; }
.fxrow.env { box-shadow: inset 3px 0 0 #40c4ff; }
.fxrow.env .icn { color: #7fd4ff; }
.fxl { flex: 1; min-width: 0; }
.fxl b { display: block; font-size: 12px; line-height: 1.15; }
.fxl .fxt { font-size: 10.5px; opacity: .6; }
.fxarrow { display: inline-block; }
.fxarrow .icn { width: 15px; height: 15px; color: #7fd4ff; }

/* emotes */
#emote-btn { position: absolute; bottom: 56px; right: 14px; z-index: 4; font-size: 16px; }
#emote-row {
  position: absolute; bottom: 96px; right: 14px; z-index: 4;
  display: flex; gap: 6px; background: rgba(12,16,36,.85); padding: 8px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(8px);
}
#emote-row .mini-btn { font-size: 19px; padding: 6px 9px; }

/* hole-in-one flash */
.gold-flash {
  position: fixed; inset: 0; z-index: 25; pointer-events: none;
  background: radial-gradient(90% 70% at 50% 50%, rgba(255,210,63,0) 40%, rgba(255,210,63,.45));
  animation: goldF 1s ease forwards;
}
@keyframes goldF { 0% { opacity: 0 } 22% { opacity: 1 } 100% { opacity: 0 } }

/* podium awards */
#podium-awards { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 20px; }
.award {
  display: flex; gap: 10px; align-items: center; text-align: left;
  background: rgba(0,0,0,.3); border: 1px solid rgba(255,210,63,.3);
  padding: 10px 16px; border-radius: 14px; animation: pop .35s ease backwards;
}
.award .icn { width: 26px; height: 26px; color: #ffd23f; }
.award b { font-size: 14px; }
.award p { font-size: 12px; opacity: .75; }

/* inline seg (bot skill) */
.seg-inline { flex: 1; margin-left: 10px; }
.seg-inline button { font-size: 12px; padding: 7px 6px; }

/* daily challenge */
.challenge-row {
  display: flex; align-items: center; gap: 8px; margin: -6px 0 14px; padding: 9px 12px;
  background: rgba(255,210,63,.08); border: 1px solid rgba(255,210,63,.3); border-radius: 12px;
  font-size: 12.5px;
}
.challenge-row .icn { width: 16px; height: 16px; color: #ffd23f; flex-shrink: 0; }
.challenge-row.done { background: rgba(61,220,132,.08); border-color: rgba(61,220,132,.3); }
.challenge-row.done .icn { color: #7cffb2; }
.vchal {
  position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, #ffd23f, #ff8c42); color: #3a2200;
  font-size: 10px; font-weight: 900; padding: 3px 8px; border-radius: 999px;
}
.vchal .icn { width: 12px; height: 12px; }

/* avatars & medals */
.avatar { display: inline-flex; }
.avatar canvas { display: block; }
.bava, .rava { display: inline-flex; flex-shrink: 0; align-items: center; }
.brow .bava { width: 17px; height: 17px; }
.rrow .rava { width: 20px; height: 20px; }
.medal { display: inline-flex; }
.medal .icn { width: 22px; height: 22px; }
.medal.m0 .icn { color: #ffd23f; filter: drop-shadow(0 2px 5px #ffd23f66); }
.medal.m1 .icn { color: #cfd8dc; filter: drop-shadow(0 2px 5px #cfd8dc55); }
.medal.m2 .icn { color: #ff9e6b; filter: drop-shadow(0 2px 5px #ff9e6b55); }
.pb-bar .medal .icn { width: 34px; height: 34px; }
.pball-skin { background: transparent !important; box-shadow: none !important; }
.pball-skin canvas { border-radius: 50%; box-shadow: 0 5px 12px rgba(0,0,0,.4); }
.pb-skin { background: transparent !important; box-shadow: none !important; }
.pb-skin canvas { border-radius: 50%; box-shadow: 0 8px 22px rgba(0,0,0,.5); }
.slot {
  background: var(--noise), linear-gradient(165deg, rgba(28,34,66,.85), rgba(10,13,28,.85));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 -2px 0 rgba(0,0,0,.3), 0 6px 16px rgba(0,0,0,.35);
}

/* svg icons */
.icn { width: 1.05em; height: 1.05em; display: inline-block; vertical-align: -0.16em; }
.slot .icn { width: 30px; height: 30px; }
.slot .sem { color: #eef2ff; }
.hitem .icn { width: 22px; height: 22px; }
.toast .icn { margin-right: 6px; vertical-align: -0.18em; }
.vcard .vem .icn { width: 42px; height: 42px; }
.intro-card .iem .icn { width: 50px; height: 50px; }
#wind-ind .icn { width: 20px; height: 20px; }
#wind-arrow { display: inline-block; margin-left: 8px; }
#wind-arrow .icn { width: 18px; height: 18px; color: #7cffb2; }
.mini-btn .icn { width: 16px; height: 16px; }
.btn .icn { vertical-align: -0.18em; margin-right: 4px; }
.sets-strip .icn { width: 14px; height: 14px; color: #7cffb2; }

/* 3D layer bits */
#labels { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.blabel {
  position: absolute; transform: translate(-50%, -100%);
  font: 700 12px Rubik, sans-serif; padding: 2px 8px; border-radius: 8px;
  background: rgba(0,0,0,.5); white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
.fxtext {
  position: absolute; transform: translate(-50%, -100%);
  font: 800 24px Rubik, sans-serif; white-space: nowrap;
  text-shadow: 0 2px 0 rgba(0,0,0,.6), 0 4px 14px rgba(0,0,0,.6);
  animation: fxRise 1.6s ease-out forwards;
}
.fxtext.big { font-size: 40px; }
@keyframes fxRise { from { opacity: 0; margin-top: 10px } 15% { opacity: 1 } to { opacity: 0; margin-top: -60px } }
#wind-ind {
  position: absolute; top: 62px; left: 50%; transform: translateX(-50%);
  padding: 7px 16px; font-weight: 900; font-size: 17px; z-index: 4;
}
#wind-arrow { display: inline-block; }
#cam-hint {
  position: absolute; bottom: 62px; right: 14px; padding: 6px 12px;
  font-size: 11.5px; opacity: .55; z-index: 3; pointer-events: none;
  animation: fadeout 1s ease 9s forwards;
}

@media (max-width: 720px) {
  #hud-top { font-size: 11.5px; padding: 6px 10px; top: 8px; max-width: calc(100vw - 12px); gap: 6px; }
  #hud-course { display: none; }
  #hud-top .hud-sep:first-of-type { display: none; }
  #hud-board { font-size: 11px; min-width: 140px; max-width: 44vw; top: 46px; }
  #left-col { top: 46px; }
  #fx-panel .fxl b { font-size: 10.5px; }
  #chatbox { width: 44vw; bottom: 88px; }
  #chat-inp { font-size: 11px; padding: 6px 9px; }
  .slot { width: 58px; height: 58px; }
  .slot .icn { width: 24px; height: 24px; }
  .slot .snm { font-size: 7.5px; }
  #btn-mull { bottom: 92px; left: auto; right: 14px; transform: none; }
  #emote-btn { bottom: 132px; }
  #emote-row { bottom: 172px; }
  #cam-hint { display: none; }
  .logo-ball { display: none; }
}

/* ---------- achievements ---------- */
.ach-list { max-height: 56vh; overflow: auto; margin: 12px 0 16px; padding-right: 4px; }
.ach-row {
  display: flex; gap: 12px; align-items: center; padding: 10px 12px; margin-bottom: 8px;
  border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid transparent;
}
.ach-row.got { background: linear-gradient(140deg, rgba(255,210,63,.14), rgba(255,140,66,.06)); border-color: #ffd23f55; }
.ach-ic .icn { width: 30px; height: 30px; }
.ach-row:not(.got) .ach-ic { opacity: .55; filter: grayscale(.6); }
.ach-body { flex: 1; min-width: 0; text-align: left; }
.ach-body p { font-size: 12px; opacity: .65; margin: 1px 0 0; }
.ach-bar { height: 5px; border-radius: 3px; background: rgba(0,0,0,.35); margin-top: 6px; overflow: hidden; }
.ach-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #3ddc84, #19b8a6); }
.ach-row.got .ach-bar i { background: linear-gradient(90deg, #ffd23f, #ff8c42); }
.ach-right { text-align: right; font-weight: 700; font-size: 13px; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; flex-shrink: 0; }
.ach-row.got .ach-right { color: #ffd23f; }
.ach-right span { display: flex; gap: 4px; align-items: center; font-size: 12px; color: #ffd23f; opacity: .85; }
.ach-right span .icn { width: 14px; height: 14px; }

/* ---------- practice course picker ---------- */
.practice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pr-course {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font: 700 11px Rubik, sans-serif; color: #cfd6ff; cursor: pointer;
  background: rgba(0,0,0,.3); border: 1.5px solid rgba(255,255,255,.12);
  border-radius: 10px; padding: 8px 4px; transition: border-color .15s, background .15s;
}
.pr-course .icn { width: 22px; height: 22px; }
.pr-course span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pr-course:not(:disabled):hover { background: rgba(255,255,255,.08); }
.pr-course.on { border-color: #3ddc84; background: rgba(61,220,132,.14); color: #7cffb2; }
.pr-course:disabled { cursor: default; opacity: .7; }

/* ---------- twemoji emotes ---------- */
.fxemoji { width: 44px; height: 44px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); }
.emote-pick { padding: 6px 8px; }
.emobtn { width: 26px; height: 26px; display: block; }
