:root {
  --green: #00a957;
  --green-dark: #006b3a;
  --ink: #07110d;
  --panel: #0f1914;
  --line: rgba(255, 255, 255, 0.12);
  --cream: #f3f1e6;
}

* { box-sizing: border-box; }

html { background: var(--ink); }

body {
  margin: 0;
  color: white;
  background:
    radial-gradient(circle at 50% 25%, rgba(0, 169, 87, .2), transparent 34rem),
    linear-gradient(rgba(3, 12, 8, .91), rgba(3, 12, 8, .98)),
    repeating-linear-gradient(90deg, #0a1b12 0 90px, #0c2016 90px 180px);
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

button, input { font: inherit; }
button { color: inherit; }
button:disabled { cursor: wait; opacity: .65; transform: none !important; }

.app-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.club-bar {
  height: 84px;
  border-bottom: 1px solid var(--line);
  padding: 0 clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(4, 12, 8, .86);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 5;
}

.brand { background: none; border: 0; display: flex; align-items: center; gap: 13px; font-size: 19px; font-weight: 900; letter-spacing: .04em; cursor: pointer; }
.brand img { width: 52px; height: 52px; object-fit: contain; }
.brand strong { color: var(--green); }
.hashtag { font-weight: 800; color: rgba(255,255,255,.55); font-size: 13px; letter-spacing: .16em; }

.home-panel, .modal-panel, .game-view {
  width: min(1120px, calc(100% - 32px));
  margin: auto;
  padding: 54px 0 42px;
  text-align: center;
  position: relative;
}
.home-panel { min-height: calc(100vh - 136px); display: flex; align-items: center; flex-direction: column; justify-content: center; }
.hero-logo { width: 108px; height: 108px; object-fit: contain; margin: 13px 0 8px; filter: drop-shadow(0 12px 24px rgba(0,0,0,.35)); }
.eyebrow { text-transform: uppercase; font-size: 11px; letter-spacing: .2em; color: rgba(255,255,255,.58); font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 9px; }
.eyebrow span { display: inline-block; width: 26px; height: 2px; background: var(--green); }
h1, h2 { margin: 0; font-weight: 950; line-height: .92; letter-spacing: -.045em; }
h1 { font-size: clamp(42px, 7vw, 88px); }
h1 em { color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.72); font-style: normal; }
h2 { font-size: clamp(36px, 5vw, 62px); }
.intro { max-width: 630px; color: rgba(255,255,255,.67); line-height: 1.6; font-size: 16px; margin: 20px auto 30px; }
.section-label { text-transform: uppercase; font-weight: 800; font-size: 10px; letter-spacing: .18em; color: rgba(255,255,255,.45); }
.difficulty-block { width: min(670px, 100%); }
.difficulty-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.difficulty {
  background: rgba(255,255,255,.045); border: 1px solid var(--line); border-radius: 3px; padding: 15px 10px; cursor: pointer; transition: .2s ease;
}
.difficulty:hover { border-color: rgba(0,169,87,.7); transform: translateY(-2px); }
.difficulty.active { background: var(--green); border-color: var(--green); box-shadow: 0 12px 36px rgba(0,169,87,.22); }
.difficulty strong { text-transform: uppercase; display: block; font-size: 14px; }
.difficulty span { display: block; font-size: 11px; color: rgba(255,255,255,.57); margin-top: 5px; }
.difficulty.active span { color: rgba(255,255,255,.8); }
.home-actions, .result-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.primary, .secondary {
  min-width: 174px; border-radius: 3px; padding: 15px 22px; text-transform: uppercase; font-size: 13px; letter-spacing: .06em; font-weight: 900; cursor: pointer; transition: .2s ease;
}
.primary { background: var(--green); border: 1px solid var(--green); box-shadow: 0 10px 28px rgba(0,169,87,.2); }
.primary:hover { background: #08bd65; transform: translateY(-2px); }
.primary span { margin-left: 25px; }
.secondary { background: transparent; border: 1px solid rgba(255,255,255,.36); }
.secondary:hover { border-color: white; background: rgba(255,255,255,.06); }
.stats-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 32px; border-top: 1px solid var(--line); padding-top: 24px; width: min(620px, 100%); }
.stats-strip div { display: flex; flex-direction: column; gap: 3px; }
.stats-strip strong { font-size: 19px; }
.stats-strip span { text-transform: uppercase; font-size: 9px; letter-spacing: .16em; color: rgba(255,255,255,.42); }

.game-view { width: min(1050px, calc(100% - 26px)); }
.scoreboard { background: rgba(15,25,20,.92); border: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 18px clamp(18px, 4vw, 45px); text-align: left; }
.scoreboard > div { display: flex; flex-direction: column; }
.scoreboard > div:last-child { text-align: right; }
.scoreboard-center { text-align: center; }
.scoreboard span { font-size: 9px; text-transform: uppercase; letter-spacing: .17em; color: rgba(255,255,255,.48); }
.scoreboard strong { font-size: 28px; margin-top: 3px; text-transform: uppercase; }
.scoreboard .green { color: #19df81; }
.scoreboard .urgent { color: #ffb000; animation: pulse .55s infinite alternate; }
.legend { display: flex; justify-content: center; gap: 38px; align-items: center; background: rgba(255,255,255,.045); border: 1px solid var(--line); padding: 13px; font-size: 12px; margin: 10px 0; }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend img { width: 30px; height: 30px; }
.legend i { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #ffc400; color: white; box-shadow: 0 0 18px #ffb000; font-style: normal; font-size: 18px; }
.arena { position: relative; height: min(56vh, 520px); min-height: 360px; overflow: hidden; border: 1px solid rgba(255,255,255,.18); background: linear-gradient(135deg, rgba(5,42,24,.97), rgba(3,22,13,.98)); touch-action: manipulation; user-select: none; }
.court-lines { position: absolute; inset: 10%; border: 2px solid rgba(255,255,255,.07); }
.court-lines::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2px solid rgba(255,255,255,.07); }
.court-lines span { position: absolute; width: 170px; height: 170px; border: 2px solid rgba(255,255,255,.07); border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%,-50%); }
.ready-card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; background: rgba(4,15,9,.58); backdrop-filter: blur(3px); z-index: 2; }
.ready-kicker { color: var(--green); text-transform: uppercase; letter-spacing: .17em; font-weight: 900; font-size: 10px; margin-bottom: 16px; }
.ready-card p { color: rgba(255,255,255,.62); margin: 16px 0 23px; }
.target { position: absolute; width: clamp(58px, 7vw, 78px); height: clamp(58px, 7vw, 78px); transform: translate(-50%,-50%); padding: 0; border-radius: 50%; border: 0; background: var(--cream); cursor: crosshair; box-shadow: 0 8px 25px rgba(0,0,0,.45), 0 0 0 5px rgba(255,255,255,.15); animation: pop .16s ease-out; }
.target img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.target.golden { color: white; background: radial-gradient(circle at 35% 30%, #fff49a, #ffb000 55%, #e27100); box-shadow: 0 0 36px rgba(255,190,0,.9), 0 8px 25px rgba(0,0,0,.4); }
.target.golden span { font-size: 36px; }
.text-button { border: 0; background: none; color: rgba(255,255,255,.5); text-transform: uppercase; font-size: 10px; letter-spacing: .14em; margin-top: 18px; cursor: pointer; }

.modal-panel { width: min(650px, calc(100% - 32px)); background: rgba(15,25,20,.92); border: 1px solid var(--line); padding: clamp(35px, 7vw, 64px); margin-top: clamp(35px, 8vh, 80px); margin-bottom: clamp(35px, 8vh, 80px); }
.modal-panel h2 { margin: 17px 0; }
.result-panel > p { color: rgba(255,255,255,.63); }
.final-score { display: block; color: #19df81; font-size: clamp(75px, 13vw, 120px); line-height: .9; }
form { text-align: left; margin: 30px auto 0; max-width: 480px; }
form label { display: block; text-transform: uppercase; letter-spacing: .13em; font-size: 9px; color: rgba(255,255,255,.5); margin-bottom: 8px; font-weight: 800; }
.name-row { display: flex; gap: 8px; }
.name-row input { flex: 1; min-width: 0; color: white; background: #08110d; border: 1px solid rgba(255,255,255,.18); border-radius: 3px; padding: 14px; outline: none; }
.name-row input:focus { border-color: var(--green); }
.name-row .primary { min-width: 120px; }
.consent-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 15px; color: rgba(255,255,255,.7); font-size: 12px; line-height: 1.45; text-transform: none; letter-spacing: 0; cursor: pointer; }
.consent-row input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--green); flex: 0 0 auto; }
.privacy-link { border: 0; background: none; color: #38d98c; padding: 8px 0 0; font-size: 11px; text-decoration: underline; cursor: pointer; }
.form-error { color: #ff9d82 !important; font-size: 12px; line-height: 1.4; margin: 10px 0 0; }
.saved-message { color: #19df81 !important; margin-top: 28px; }
.score-list { list-style: none; padding: 0; margin: 28px 0 10px; text-align: left; border-top: 1px solid var(--line); }
.score-list li { display: grid; grid-template-columns: 45px 1fr auto 48px 28px; gap: 10px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.score-list .rank { color: var(--green); font-weight: 900; }
.score-list small { color: rgba(255,255,255,.42); font-size: 10px; text-transform: uppercase; }
.score-list b { font-size: 22px; text-align: right; }
.delete-score { width: 27px; height: 27px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; background: transparent; color: rgba(255,255,255,.55); cursor: pointer; line-height: 1; }
.delete-score:hover { border-color: #ff826b; color: #ff826b; }
.empty-state { margin: 35px 0; color: rgba(255,255,255,.55); line-height: 1.6; }
.empty-state img { width: 90px; opacity: .42; }
.local-results { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.local-results h3 { margin: 0; color: rgba(255,255,255,.45); font-size: 10px; letter-spacing: .17em; }

footer { margin-top: auto; min-height: 52px; border-top: 1px solid var(--line); padding: 0 clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; color: rgba(255,255,255,.35); text-transform: uppercase; font-size: 9px; letter-spacing: .12em; }
footer div { display: flex; align-items: center; gap: 20px; }
footer a, footer button { color: rgba(255,255,255,.55); text-decoration: none; }
footer button { border: 0; background: none; padding: 0; text-transform: uppercase; font-size: inherit; letter-spacing: inherit; cursor: pointer; }

.privacy-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; background: rgba(0,0,0,.78); backdrop-filter: blur(8px); }
.privacy-modal { position: relative; width: min(680px, 100%); max-height: min(760px, calc(100vh - 36px)); overflow-y: auto; padding: clamp(28px, 6vw, 55px); background: #101b15; border: 1px solid rgba(255,255,255,.17); box-shadow: 0 30px 90px rgba(0,0,0,.55); }
.privacy-modal h2 { font-size: clamp(29px, 5vw, 47px); margin: 18px 0 25px; }
.privacy-modal p { color: rgba(255,255,255,.68); font-size: 13px; line-height: 1.65; text-align: left; }
.privacy-modal p strong, .privacy-modal a { color: white; }
.privacy-modal h3 { margin: 24px 0 8px; text-align: left; font-size: 15px; }
.privacy-modal ul { margin: 8px 0 18px; padding-left: 20px; color: rgba(255,255,255,.68); font-size: 13px; line-height: 1.65; text-align: left; }
.privacy-modal code { color: #72e5ad; overflow-wrap: anywhere; }
.privacy-modal .legal-warning { padding: 12px 14px; color: #ffd4a8; background: rgba(255,140,35,.1); border: 1px solid rgba(255,160,70,.42); }
.privacy-modal .primary { margin-top: 16px; }
.modal-close { position: absolute; top: 14px; right: 16px; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; background: transparent; font-size: 24px; cursor: pointer; }

.storage-notice {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(760px, calc(100% - 28px));
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  background: #101b15;
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: 0 18px 60px rgba(0,0,0,.58);
}
.storage-notice p { flex: 1; margin: 0; color: rgba(255,255,255,.76); font-size: 12px; line-height: 1.5; }
.storage-notice strong { color: white; }
.storage-notice .notice-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 12px; }
.storage-notice .privacy-link { padding: 10px 0; }
.storage-notice .primary { min-width: 110px; padding: 12px 16px; }

@keyframes pop { from { transform: translate(-50%,-50%) scale(.3); opacity: .2; } to { transform: translate(-50%,-50%) scale(1); opacity: 1; } }
@keyframes pulse { to { transform: scale(1.08); } }

@media (max-width: 620px) {
  .club-bar { height: 70px; padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .brand { font-size: 14px; gap: 8px; }
  .brand img { width: 42px; height: 42px; }
  .hashtag { display: none; }
  .home-panel { padding: 28px 0 30px; min-height: calc(100dvh - 130px); }
  h1 { font-size: clamp(39px, 13vw, 58px); }
  .hero-logo { width: 86px; height: 86px; }
  .difficulty-grid { gap: 5px; }
  .difficulty { padding: 13px 5px; }
  .difficulty span { font-size: 9px; }
  .home-actions, .result-actions { width: 100%; gap: 7px; }
  .home-actions button, .result-actions button { min-width: 0; flex: 1; }
  .stats-strip { gap: 10px; }
  .legend { gap: 15px; font-size: 9px; }
  .scoreboard { padding: 14px; }
  .scoreboard strong { font-size: 21px; }
  .arena { height: clamp(320px, calc(100dvh - 245px), 500px); min-height: 320px; }
  .primary, .secondary { min-height: 48px; }
  .modal-panel { padding: 36px 20px; }
  .name-row { flex-direction: column; }
  .score-list li { grid-template-columns: 34px 1fr 42px 27px; }
  .score-list small { display: none; }
  footer { gap: 12px; flex-direction: column; justify-content: center; padding: 14px 20px; }
  footer div { gap: 12px; }
  .privacy-modal { max-height: calc(100dvh - 24px); padding: 34px 20px 24px; }
  .storage-notice { bottom: max(8px, env(safe-area-inset-bottom)); align-items: stretch; flex-direction: column; gap: 10px; padding: 14px; }
  .storage-notice .notice-actions { justify-content: space-between; }
}

@media (max-height: 600px) and (orientation: landscape) {
  .club-bar { height: 54px; }
  .brand img { width: 36px; height: 36px; }
  .game-view { padding: 7px 0; }
  .scoreboard { padding: 7px 15px; }
  .scoreboard strong { font-size: 19px; }
  .legend { margin: 5px 0; padding: 5px; }
  .legend img, .legend i { width: 24px; height: 24px; }
  .arena { height: calc(100dvh - 152px); min-height: 210px; }
  .text-button { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
}

h1,
h2 {
  font-weight: 900;
}

h1 em {
  color: rgba(255, 255, 255, 0.12);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.75);
  paint-order: stroke fill;
}

@media (max-width: 620px) {
  h1 {
    font-size: clamp(42px, 12vw, 54px);
    line-height: 0.94;
    letter-spacing: -0.045em;
  }

  h1 em {
    color: rgba(255, 255, 255, 0.9);
    -webkit-text-stroke: 0;
  }

  .intro {
    max-width: 340px;
    margin: 18px auto 26px;
    font-size: 15px;
    line-height: 1.55;
  }

  .eyebrow {
    font-size: 9px;
    letter-spacing: 0.15em;
  }

  .brand {
    font-weight: 800;
    letter-spacing: 0.02em;
  }
}