:root{
  --forest:#103b2d;
  --forest-dark:#061d16;
  --forest-mid:#17533e;
  --lake:#0c6d78;
  --lake-light:#39a9b6;
  --cream:#f4f0de;
  --paper:#e7dfc7;
  --wood:#80542f;
  --orange:#d86d27;
  --gold:#e3a52f;
  --text:#eef5eb;
  --muted:#b8c9bd;
  --line:rgba(235,244,231,.13);
}

*{box-sizing:border-box}

html{
  min-height:100%;
  background:var(--forest-dark);
}

body{
  margin:0;
  min-height:100vh;
  color:var(--text);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:
    radial-gradient(circle at 50% -10%,rgba(57,169,182,.18),transparent 34rem),
    linear-gradient(180deg,#0b3328 0%,#071f18 44%,#061913 100%);
}

button,input{font:inherit}

button{
  cursor:pointer;
  border:1px solid rgba(255,255,255,.16);
  border-radius:14px;
  color:var(--text);
  background:#153f31;
  font-weight:850;
  padding:12px 16px;
}

button:hover{filter:brightness(1.08)}

.primary{
  color:#162119;
  border-color:#efc76e;
  background:linear-gradient(180deg,#efbd57,#d98b2b);
}

.app-shell{
  width:min(1240px,100%);
  margin:auto;
  padding:14px;
}

.topbar{
  display:flex;
  align-items:center;
  gap:18px;
  padding:8px 4px 16px;
}

.topbar h1{margin:0;font-size:clamp(1.45rem,4vw,2.35rem)}
.topbar p{margin:3px 0 0;color:var(--muted)}

.back-link{
  flex:0 0 auto;
  color:#efbd57;
  font-weight:900;
  text-decoration:none;
}

.panel{
  border:1px solid var(--line);
  border-radius:24px;
  background:linear-gradient(145deg,rgba(28,76,59,.78),rgba(8,31,24,.94));
  box-shadow:0 18px 48px rgba(0,0,0,.20);
}

.menu-panel{padding:clamp(20px,4vw,42px)}

.menu-copy{
  max-width:680px;
  margin:0 auto 28px;
  text-align:center;
}

.eyebrow{
  color:#e3b963;
  font-size:12px;
  line-height:1.4;
  font-weight:950;
  letter-spacing:.17em;
}

.menu-copy h2,.end-panel h2{
  margin:8px 0 10px;
  font-size:clamp(2rem,6vw,3.8rem);
}

.menu-copy p{color:var(--muted);line-height:1.55}

.mode-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}

.mode-card{
  min-height:210px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:20px;
  text-align:center;
  background:linear-gradient(145deg,#174b39,#0a291f);
}

.mode-card strong{font-size:1.2rem}
.mode-card span:last-child{color:var(--muted);font-size:.9rem;line-height:1.4}
.mode-card img{width:94px;height:94px;object-fit:contain}
.mode-icon{font-size:4rem}

.online-box{
  max-width:620px;
  margin:22px auto 0;
  padding:18px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(0,0,0,.12);
}

.online-actions{
  display:grid;
  grid-template-columns:1fr 1.35fr;
  gap:10px;
}

.join-row{display:grid;grid-template-columns:1fr auto;gap:8px}

.join-row input{
  min-width:0;
  padding:12px;
  border:1px solid #5e7d70;
  border-radius:12px;
  text-transform:uppercase;
  letter-spacing:.15em;
}

.status{margin:10px 0 0;color:var(--muted)}

.hud{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  margin-bottom:10px;
}

.hud-block,.player-card,.room-card{
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(12,55,42,.82);
}

.hud-block strong,.player-card strong,.room-card strong{
  display:block;
  margin-top:2px;
}

.hud-label{
  display:block;
  color:#8eaa99;
  font-size:.68rem;
  font-weight:900;
  letter-spacing:.10em;
}

.game-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 290px;
  gap:12px;
}

.course-panel{
  position:relative;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:20px;
  background:#122f24;
  box-shadow:0 12px 32px rgba(0,0,0,.18);
}

#course{
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:9/14;
  touch-action:none;
  user-select:none;
  background:#4f7a42;
}

.turn-banner{
  position:absolute;
  top:12px;
  left:50%;
  transform:translateX(-50%);
  z-index:4;
  padding:8px 14px;
  border-radius:999px;
  background:rgba(6,29,22,.84);
  border:1px solid rgba(255,255,255,.14);
  font-weight:900;
  backdrop-filter:blur(8px);
}

.throw-help{
  position:absolute;
  left:10px;
  right:10px;
  bottom:10px;
  padding:9px 11px;
  border-radius:11px;
  background:rgba(6,29,22,.82);
  color:#dbe8df;
  font-size:.76rem;
  line-height:1.35;
  pointer-events:none;
}

.side-panel{display:grid;align-content:start;gap:10px}

.score-card,.wisco-card{
  border:1px solid var(--line);
  border-radius:18px;
  background:linear-gradient(145deg,rgba(28,76,59,.78),rgba(8,31,24,.94));
  padding:14px;
}

.score-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
}

.score-head h3{margin:0}

.ghost-small{
  min-height:0;
  padding:6px 9px;
  font-size:.72rem;
  background:rgba(255,255,255,.05);
}

.score-table{
  width:100%;
  margin-top:10px;
  border-collapse:collapse;
  font-size:.78rem;
}

.score-table th,.score-table td{
  padding:5px 4px;
  border-bottom:1px solid rgba(255,255,255,.08);
  text-align:center;
}

.score-table th:first-child,.score-table td:first-child{text-align:left}
.score-table .active-hole{color:#ffd06b;font-weight:900}

.player-card{
  display:grid;
  grid-template-columns:1fr 1fr;
}

.wisco-card{
  display:flex;
  align-items:center;
  gap:12px;
}

.wisco-card img{width:76px;height:76px;object-fit:contain}
.wisco-card p{margin:4px 0 0;color:var(--muted);font-size:.82rem}
.room-card{text-align:center}
.room-card strong{font-size:1.5rem;letter-spacing:.18em;color:#ffd06b}
.room-card p{margin:5px 0 0;color:var(--muted);font-size:.8rem}

.end-panel{
  max-width:760px;
  margin:auto;
  padding:32px;
  text-align:center;
}

.end-panel p{color:var(--muted)}
.final-scores{margin:22px auto;max-width:520px}
.final-score-row{
  display:flex;
  justify-content:space-between;
  gap:20px;
  padding:12px 14px;
  border-bottom:1px solid var(--line);
}
.final-score-row strong:last-child{color:#ffd06b}
.end-actions{display:flex;justify-content:center;gap:10px}

@media(max-width:850px){
  .mode-grid{grid-template-columns:1fr}
  .mode-card{min-height:150px}
  .game-layout{grid-template-columns:1fr}
  .side-panel{grid-template-columns:1fr 1fr}
  .score-card{grid-column:1/-1}
}

@media(max-width:560px){
  .app-shell{padding:8px}
  .topbar{align-items:flex-start}
  .topbar p{font-size:.78rem}
  .hud{grid-template-columns:1fr 1fr}
  .game-layout{gap:8px}
  .side-panel{grid-template-columns:1fr}
  .online-actions{grid-template-columns:1fr}
  .mode-card{min-height:130px}
  .mode-card img{width:72px;height:72px}
  .mode-icon{font-size:3rem}
  .throw-help{font-size:.69rem}
  .end-actions{display:grid}
  .end-actions button{width:100%}
}
/* =========================================================
   DISC GOLF VIEWPORT + MOBILE PLAYABILITY v1.3
   ========================================================= */

html,
body{
  overflow-x:hidden;
  overflow-y:auto;
}

.app-shell{
  width:min(1180px,100%);
  padding:10px;
}

.topbar{
  padding:4px 4px 9px;
  gap:12px;
}

.topbar h1{
  font-size:clamp(1.3rem,3vw,2rem);
}

.topbar p{
  font-size:.88rem;
  margin-top:1px;
}

.hud{
  max-width:1000px;
  margin-left:auto;
  margin-right:auto;
  margin-bottom:8px;
}

.game-layout{
  width:min(100%,1000px);
  margin:0 auto;
  grid-template-columns:minmax(0,1fr) 260px;
  align-items:start;
  justify-content:center;
  gap:10px;
}

.course-panel{
  width:min(
    100%,
    620px,
    calc((100dvh - 190px) * 9 / 14)
  );
  min-width:0;
  justify-self:center;
}

#course{
  width:100%;
  height:auto;
  max-height:calc(100dvh - 190px);
  aspect-ratio:9/14;
}

.side-panel{
  min-width:0;
}

@media(min-width:851px) and (max-height:820px){
  .app-shell{padding-top:5px}
  .topbar{padding-bottom:5px}
  .topbar p{display:none}

  .hud-block,
  .player-card,
  .room-card{
    padding:7px 9px;
  }

  .course-panel{
    width:min(
      100%,
      500px,
      calc((100dvh - 135px) * 9 / 14)
    );
  }

  #course{
    max-height:calc(100dvh - 135px);
  }

  .score-card,
  .wisco-card{
    padding:10px;
  }

  .score-table{
    font-size:.70rem;
  }

  .score-table th,
  .score-table td{
    padding:3px 2px;
  }
}

/* Tablets */
@media(max-width:850px) and (min-width:681px){
  .game-layout{
    grid-template-columns:minmax(0,1fr) 220px;
    width:min(100%,850px);
  }

  .course-panel{
    width:min(
      100%,
      560px,
      calc((100dvh - 180px) * 9 / 14)
    );
  }

  #course{
    max-height:calc(100dvh - 180px);
  }

  .side-panel{
    grid-template-columns:1fr;
  }

  .score-card{
    grid-column:auto;
  }
}

/* Phones */
@media(max-width:680px){

  .app-shell{
    width:100%;
    padding:6px;
  }

  .topbar{
    gap:8px;
    padding:4px 2px 7px;
  }

  .topbar h1{
    font-size:clamp(1.18rem,5.4vw,1.65rem);
    line-height:1.05;
  }

  .topbar p{
    display:none;
  }

  .back-link{
    font-size:.78rem;
  }

  .hud{
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:4px;
    margin-bottom:6px;
  }

  .hud-block{
    padding:6px 5px;
    border-radius:10px;
  }

  .hud-label{
    font-size:.50rem;
    letter-spacing:.04em;
  }

  .hud-block strong{
    font-size:.78rem;
    line-height:1.05;
  }

  .game-layout{
    display:block;
    width:100%;
    margin:0;
  }

  /*
   * The wrapper is no longer a fixed-height clipping box on mobile.
   * The canvas itself gets the viewport-height limit.
   */
  .course-panel{
    width:100%;
    height:auto;
    max-width:calc(100vw - 12px);
    aspect-ratio:auto;
    margin:0 auto 8px;
    overflow:visible;
  }

  #course{
    display:block;
    width:auto;
    height:min(56dvh,620px);
    max-width:100%;
    max-height:none;
    aspect-ratio:9/14;
    margin:0 auto;
    border-radius:18px;
  }

  .turn-banner{
    top:6px;
    padding:5px 9px;
    font-size:.76rem;
  }

  /*
   * Critical change: instructions are BELOW the playable canvas,
   * not layered over the tee/disc.
   */
  .throw-help{
    position:relative;
    left:auto;
    right:auto;
    bottom:auto;
    margin:6px;
    padding:7px 9px;
    font-size:.64rem;
    line-height:1.25;
  }

  .side-panel{
    width:min(100%,430px);
    margin:0 auto;
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }

  .score-card,
  .wisco-card,
  .player-card,
  .room-card{
    padding:9px;
  }

  .score-table{
    font-size:.68rem;
  }

  .score-table th,
  .score-table td{
    padding:3px 2px;
  }
}

@media(max-width:680px) and (max-height:760px){
  #course{
    height:min(50dvh,500px);
  }

  .hud{
    margin-bottom:4px;
  }

  .hud-block{
    padding:5px 4px;
  }
}
/* =========================================================
   v1.4.1 - MOBILE TURN BANNER FIX
   Keep "Your throw" OUTSIDE the playable canvas so it can
   never cover the disc or block touch/mouse input.
   ========================================================= */

@media(max-width:680px){

  .course-panel{
    display:flex;
    flex-direction:column;
    align-items:center;
    overflow:visible;
  }

  .turn-banner{
    position:relative;
    top:auto;
    left:auto;
    transform:none;

    order:1;

    align-self:center;

    margin:7px 0 7px;
    padding:5px 10px;

    font-size:.74rem;

    pointer-events:none;
    z-index:1;
  }

  #course{
    order:2;
  }

  .throw-help{
    order:3;
  }
}

/* Also make sure the banner can never steal a click anywhere */
.turn-banner{
  pointer-events:none;
}
/* =========================================================
   v1.5.1 - TURN INDICATOR SIDE POSITION
   Keep the turn indicator away from the center flight line
   and away from discs that stop near the basket/tee.
   ========================================================= */

/* Desktop/tablet: pin it to the upper-left edge of the course. */
.turn-banner{
  position:absolute;
  top:10px;
  left:10px;
  right:auto;
  transform:none;
  margin:0;
  pointer-events:none;
  z-index:3;
}

/* Phones: keep it on the left side above the canvas. */
@media(max-width:680px){
  .course-panel{
    position:relative;
  }

  .turn-banner{
    position:relative;
    top:auto;
    left:auto;
    right:auto;
    transform:none;
    align-self:flex-start;
    margin:6px 0 6px 8px;
    pointer-events:none;
  }
}
/* =========================================================
   v1.7 - FULL SCREEN / FOCUS MODE
   ========================================================= */

.play-area{
  position:relative;
}

.play-toolbar{
  width:min(100%,1000px);
  margin:0 auto 7px;
  display:flex;
  justify-content:flex-end;
  align-items:center;
}

.fullscreen-btn{
  min-height:0;
  padding:8px 12px;
  border-radius:999px;
  font-size:.78rem;
  line-height:1;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.18);
  box-shadow:none;
}

.fullscreen-btn:hover{
  background:rgba(255,255,255,.12);
}

/*
 * Browsers with the real Fullscreen API apply :fullscreen to playArea.
 */
.play-area:fullscreen{
  width:100vw;
  height:100vh;
  height:100dvh;
  max-width:none;
  padding:8px;
  overflow:auto;
  background:
    radial-gradient(circle at 50% -10%,rgba(57,169,182,.18),transparent 34rem),
    linear-gradient(180deg,#0b3328 0%,#071f18 44%,#061913 100%);
}

.play-area:fullscreen .play-toolbar{
  width:min(100%,1200px);
}

.play-area:fullscreen .hud{
  width:min(100%,1200px);
  max-width:none;
}

.play-area:fullscreen .game-layout{
  width:min(100%,1200px);
  max-width:none;
}

/*
 * Safari/WebKit variant.
 */
.play-area:-webkit-full-screen{
  width:100vw;
  height:100vh;
  padding:8px;
  overflow:auto;
  background:#071f18;
}

/*
 * CSS-only fallback used when a browser/device does not permit
 * element.requestFullscreen() (notably some iPhone browser contexts).
 */
body.course-focus-mode{
  overflow:hidden !important;
}

body.course-focus-mode .focus-mode-target{
  position:fixed;
  inset:0;
  z-index:99999;
  width:100vw;
  height:100vh;
  height:100dvh;
  max-width:none;
  margin:0;
  padding:8px;
  overflow:auto;
  background:
    radial-gradient(circle at 50% -10%,rgba(57,169,182,.18),transparent 34rem),
    linear-gradient(180deg,#0b3328 0%,#071f18 44%,#061913 100%);
}

/* Desktop/tablet fullscreen: maximize course while keeping sidebar. */
@media(min-width:681px){
  .play-area:fullscreen .course-panel,
  body.course-focus-mode .focus-mode-target .course-panel{
    width:min(
      100%,
      680px,
      calc((100dvh - 125px) * 9 / 14)
    );
  }

  .play-area:fullscreen #course,
  body.course-focus-mode .focus-mode-target #course{
    max-height:calc(100dvh - 125px);
  }
}

/* Phones: fullscreen becomes a purpose-built game view. */
@media(max-width:680px){

  .play-toolbar{
    margin-bottom:5px;
  }

  .fullscreen-btn{
    padding:7px 10px;
    font-size:.70rem;
  }

  .play-area:fullscreen,
  body.course-focus-mode .focus-mode-target{
    padding:5px;
  }

  .play-area:fullscreen .play-toolbar,
  body.course-focus-mode .focus-mode-target .play-toolbar{
    position:sticky;
    top:0;
    z-index:20;
    margin-bottom:4px;
    padding:2px 0;
    background:rgba(7,31,24,.92);
    backdrop-filter:blur(8px);
  }

  .play-area:fullscreen .hud,
  body.course-focus-mode .focus-mode-target .hud{
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:3px;
    margin-bottom:4px;
  }

  .play-area:fullscreen .hud-block,
  body.course-focus-mode .focus-mode-target .hud-block{
    padding:5px 4px;
  }

  .play-area:fullscreen .game-layout,
  body.course-focus-mode .focus-mode-target .game-layout{
    display:block;
    width:100%;
  }

  .play-area:fullscreen .course-panel,
  body.course-focus-mode .focus-mode-target .course-panel{
    width:100%;
    height:auto;
    max-width:calc(100vw - 10px);
    margin:0 auto 5px;
    overflow:visible;
  }

  /*
   * Give the course most of the available phone screen.
   * Instructions remain below the canvas.
   */
  .play-area:fullscreen #course,
  body.course-focus-mode .focus-mode-target #course{
    width:auto;
    height:min(70dvh,760px);
    max-width:100%;
    max-height:none;
    margin:0 auto;
  }

  .play-area:fullscreen .throw-help,
  body.course-focus-mode .focus-mode-target .throw-help{
    margin:4px 2px 6px;
    padding:5px 7px;
    font-size:.56rem;
  }

  .play-area:fullscreen .side-panel,
  body.course-focus-mode .focus-mode-target .side-panel{
    width:min(100%,430px);
    margin:0 auto;
    gap:5px;
  }

  .play-area:fullscreen .score-card,
  .play-area:fullscreen .player-card,
  .play-area:fullscreen .wisco-card,
  .play-area:fullscreen .room-card,
  body.course-focus-mode .focus-mode-target .score-card,
  body.course-focus-mode .focus-mode-target .player-card,
  body.course-focus-mode .focus-mode-target .wisco-card,
  body.course-focus-mode .focus-mode-target .room-card{
    padding:7px;
  }
}

/* Landscape phones have enough width to show course + compact sidebar. */
@media(max-width:950px) and (orientation:landscape) and (max-height:600px){

  .play-area:fullscreen,
  body.course-focus-mode .focus-mode-target{
    overflow:hidden;
  }

  .play-area:fullscreen .hud,
  body.course-focus-mode .focus-mode-target .hud{
    max-width:940px;
  }

  .play-area:fullscreen .game-layout,
  body.course-focus-mode .focus-mode-target .game-layout{
    display:grid;
    grid-template-columns:minmax(0,1fr) 220px;
    width:min(100%,940px);
    gap:7px;
  }

  .play-area:fullscreen .course-panel,
  body.course-focus-mode .focus-mode-target .course-panel{
    width:min(
      100%,
      calc((100dvh - 90px) * 9 / 14)
    );
    margin:0 auto;
  }

  .play-area:fullscreen #course,
  body.course-focus-mode .focus-mode-target #course{
    height:auto;
    width:100%;
    max-height:calc(100dvh - 90px);
  }

  .play-area:fullscreen .throw-help,
  body.course-focus-mode .focus-mode-target .throw-help{
    display:none;
  }

  .play-area:fullscreen .side-panel,
  body.course-focus-mode .focus-mode-target .side-panel{
    width:100%;
    max-height:calc(100dvh - 90px);
    overflow:auto;
  }
}
/* v1.10 - TABLET FULLSCREEN FIT FIX */

@media(min-width:681px) and (max-width:1180px){

  .play-area:fullscreen,
  .play-area:-webkit-full-screen,
  body.course-focus-mode .focus-mode-target{
    overflow:hidden;
    padding:6px;
  }

  .play-area:fullscreen .play-toolbar,
  .play-area:-webkit-full-screen .play-toolbar,
  body.course-focus-mode .focus-mode-target .play-toolbar,
  .play-area:fullscreen .hud,
  .play-area:-webkit-full-screen .hud,
  body.course-focus-mode .focus-mode-target .hud{
    width:min(100%,1050px);
    max-width:none;
    margin-left:auto;
    margin-right:auto;
  }

  .play-area:fullscreen .game-layout,
  .play-area:-webkit-full-screen .game-layout,
  body.course-focus-mode .focus-mode-target .game-layout{
    display:grid;
    grid-template-columns:minmax(0,1fr) 220px;
    width:min(100%,1050px);
    max-width:none;
    margin:0 auto;
    gap:8px;
    align-items:start;
  }

  .play-area:fullscreen .course-panel,
  .play-area:-webkit-full-screen .course-panel,
  body.course-focus-mode .focus-mode-target .course-panel{
    width:min(
      100%,
      560px,
      calc((100dvh - 105px) * 9 / 14)
    );
    max-width:100%;
    height:auto;
    aspect-ratio:9/14;
    margin:0 auto;
    overflow:visible;
  }

  .play-area:fullscreen #course,
  .play-area:-webkit-full-screen #course,
  body.course-focus-mode .focus-mode-target #course{
    display:block;
    width:100%;
    height:auto;
    max-height:calc(100dvh - 105px);
    aspect-ratio:9/14;
    margin:0 auto;
  }

  .play-area:fullscreen .side-panel,
  .play-area:-webkit-full-screen .side-panel,
  body.course-focus-mode .focus-mode-target .side-panel{
    width:100%;
    max-height:calc(100dvh - 105px);
    overflow:auto;
    gap:7px;
  }

  .play-area:fullscreen .throw-help,
  .play-area:-webkit-full-screen .throw-help,
  body.course-focus-mode .focus-mode-target .throw-help{
    font-size:.58rem;
    line-height:1.2;
    padding:5px 7px;
  }
}

@media(min-width:681px) and (max-width:1180px) and (max-height:820px){
  .play-area:fullscreen .course-panel,
  .play-area:-webkit-full-screen .course-panel,
  body.course-focus-mode .focus-mode-target .course-panel{
    width:min(
      100%,
      500px,
      calc((100dvh - 88px) * 9 / 14)
    );
  }

  .play-area:fullscreen #course,
  .play-area:-webkit-full-screen #course,
  body.course-focus-mode .focus-mode-target #course,
  .play-area:fullscreen .side-panel,
  .play-area:-webkit-full-screen .side-panel,
  body.course-focus-mode .focus-mode-target .side-panel{
    max-height:calc(100dvh - 88px);
  }
}

@media(min-width:681px) and (max-width:1180px) and (orientation:landscape){
  .play-area:fullscreen .game-layout,
  .play-area:-webkit-full-screen .game-layout,
  body.course-focus-mode .focus-mode-target .game-layout{
    grid-template-columns:minmax(0,1fr) 240px;
    width:min(100%,1100px);
  }

  .play-area:fullscreen .course-panel,
  .play-area:-webkit-full-screen .course-panel,
  body.course-focus-mode .focus-mode-target .course-panel{
    width:min(
      100%,
      calc((100dvh - 90px) * 9 / 14)
    );
  }

  .play-area:fullscreen #course,
  .play-area:-webkit-full-screen #course,
  body.course-focus-mode .focus-mode-target #course{
    max-height:calc(100dvh - 90px);
  }

  .play-area:fullscreen .throw-help,
  .play-area:-webkit-full-screen .throw-help,
  body.course-focus-mode .focus-mode-target .throw-help{
    display:none;
  }
}
/* =========================================================
   v1.11 - POWER / PAR / END-SCREEN POLISH
   ========================================================= */

.score-table .par-row td{
  color:#9eb5a7;
  font-weight:800;
  background:rgba(255,255,255,.025);
}

.score-table .par-row td:first-child{
  color:#e3b963;
}

/*
 * A little visual breathing room around the bottom of the course.
 * The actual power fix is in game.js: 100% power now takes a shorter
 * pull while preserving the old maximum throw distance.
 */
.course-panel{
  padding-bottom:4px;
}

.play-area:fullscreen .course-panel,
body.course-focus-mode .focus-mode-target .course-panel{
  padding-bottom:6px;
}

.final-score-table{
  margin-bottom:14px;
}
/* =========================================================
   MENU HELPER WISCO - MOBILE OBSTRUCTION FIX
   ========================================================= */

/*
 * This is decorative only. On small/short screens it should never
 * cover the Join button or room-code controls.
 */
.scroll-hide-wisco{
  transition:opacity .18s ease, visibility .18s ease, transform .18s ease;
}

/* Phones/tablets with little vertical room (keyboard open, landscape, etc.) */
@media(max-width:900px) and (max-height:820px){
  .scroll-hide-wisco{
    opacity:0 !important;
    visibility:hidden !important;
    pointer-events:none !important;
    transform:translateY(20px) scale(.92) !important;
  }
}

/* JS toggles this as the user gets near the lower part of the menu. */
body.hide-menu-wisco .scroll-hide-wisco{
  opacity:0 !important;
  visibility:hidden !important;
  pointer-events:none !important;
  transform:translateY(20px) scale(.92) !important;
}
/* =========================================================
   WISCO LANES + LATEST 10 HOLE-IN-ONES
   ========================================================= */

.play-toolbar{
  justify-content:space-between;
  gap:10px;
}

.course-chip{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:34px;
  padding:6px 11px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:999px;
  background:rgba(255,255,255,.055);
}

.course-chip span{
  color:#96b4a5;
  font-size:.57rem;
  font-weight:900;
  letter-spacing:.12em;
}

.course-chip strong{
  color:#ffd06b;
  font-size:.78rem;
}

.ace-prompt,
.ace-board{
  width:min(100%,780px);
  margin:20px auto 0;
  padding:18px;
  border:1px solid rgba(255,255,255,.13);
  border-radius:18px;
  background:rgba(255,255,255,.035);
  text-align:left;
}

.ace-prompt{
  border-color:rgba(255,208,107,.45);
  background:rgba(255,208,107,.07);
}

.ace-kicker{
  margin-bottom:4px;
  color:#ffd06b;
  font-size:.68rem;
  font-weight:950;
  letter-spacing:.13em;
}

.ace-prompt h3,
.ace-board h3{
  margin:0;
  color:#fffdf2;
  font-size:1.25rem;
}

.ace-prompt p{
  margin:7px 0 12px;
  color:#d5dfd9;
}

.ace-entry-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
}

.ace-entry-row input{
  width:100%;
  min-width:0;
  padding:11px 12px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:11px;
  background:#f7f5ed;
  color:#17231e;
  font:inherit;
  font-weight:800;
}

.ace-status{
  min-height:1.2em;
  margin:8px 0 0 !important;
  color:#ffd06b !important;
  font-size:.82rem;
  font-weight:800;
}

.ace-board-heading{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:end;
  margin-bottom:12px;
}

.ace-board-list{
  overflow-x:auto;
}

.ace-table{
  width:100%;
  border-collapse:collapse;
  font-size:.82rem;
}

.ace-table th,
.ace-table td{
  padding:8px 7px;
  border-bottom:1px solid rgba(255,255,255,.09);
  text-align:left;
  white-space:nowrap;
}

.ace-table th{
  color:#9eb5a7;
  font-size:.66rem;
  letter-spacing:.05em;
  text-transform:uppercase;
}

.ace-table td:first-child{
  color:#fffdf2;
  font-weight:900;
}

.ace-table .ace-hole{
  color:#ffd06b;
  font-weight:950;
}

.ace-empty{
  margin:0;
  color:#9eb5a7;
  text-align:center;
  padding:12px;
}

@media(max-width:680px){
  .play-toolbar{
    align-items:center;
  }

  .course-chip{
    padding:5px 8px;
  }

  .course-chip span{
    display:none;
  }

  .course-chip strong{
    font-size:.68rem;
  }

  .ace-prompt,
  .ace-board{
    padding:13px;
    margin-top:14px;
  }

  .ace-entry-row{
    grid-template-columns:1fr;
  }

  .ace-entry-row button{
    width:100%;
  }

  .ace-table{
    font-size:.72rem;
  }

  .ace-table th,
  .ace-table td{
    padding:7px 5px;
  }
}
/* =========================================================
   MULTI-COURSE PICKER — WISCO LANES + PINECREST PARK
   ========================================================= */

.course-picker{
  width:min(100%,1000px);
  margin:22px auto 18px;
  display:grid;
  grid-template-columns:1fr 1.3fr;
  gap:12px;
}

.course-option{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:15px;
  border:1px solid rgba(255,255,255,.13);
  border-radius:16px;
  background:rgba(255,255,255,.035);
}

.course-option-copy{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:3px;
  text-align:left;
}

.course-option-copy strong{
  color:#fffdf2;
  font-size:1.06rem;
}

.course-option-copy small{
  color:#a9beb3;
  font-size:.76rem;
}

.course-badge{
  color:#ffd06b;
  font-size:.56rem;
  font-weight:950;
  letter-spacing:.11em;
}

.course-badge.real-course{
  color:#84d6d8;
}

.round-choice-row{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.round-choice{
  min-height:0;
  padding:9px 12px;
  border-radius:999px;
  white-space:nowrap;
  background:rgba(255,255,255,.07);
}

.round-choice.selected{
  color:#10261e;
  border-color:#ffd06b;
  background:linear-gradient(180deg,#f6c55d,#e89b2d);
  box-shadow:0 0 0 2px rgba(255,208,107,.14);
}

.selected-round-line{
  width:min(100%,1000px);
  margin:0 auto 15px;
  color:#9eb5a7;
  font-size:.78rem;
}

.selected-round-line strong{
  margin-left:5px;
  color:#ffd06b;
}

/* 18 holes are shown as Front 9 / Back 9 instead of one unreadably wide table. */
.score-nine-group + .score-nine-group{
  margin-top:9px;
  padding-top:8px;
  border-top:1px solid rgba(255,255,255,.10);
}

.score-group-label{
  margin:0 0 4px;
  color:#9eb5a7;
  font-size:.58rem;
  font-weight:950;
  letter-spacing:.10em;
  text-transform:uppercase;
}

.final-score-group{
  overflow-x:auto;
  margin-top:12px;
}

.final-score-group .score-table{
  min-width:620px;
}

.end-panel .final-score-group + .final-score-group{
  margin-top:16px;
}

@media(max-width:760px){
  .course-picker{
    grid-template-columns:1fr;
  }

  .course-option{
    align-items:flex-start;
  }

  .pinecrest-option{
    flex-direction:column;
  }

  .round-choice-row{
    width:100%;
    justify-content:stretch;
  }

  .round-choice-row .round-choice{
    flex:1;
  }
}


/* === Final scorecard polish v4 ===
   No horizontal browser-style scrollbar on completed-round scorecards.
   Keep the score table inside its card and protect the left Player/Par labels.
*/
.result-card,
.results-card,
.round-results,
.final-scorecard,
.end-scorecard,
.scorecard-final,
#results,
#roundResults {
  overflow-x: visible !important;
  max-width: 100%;
}

.result-card table,
.results-card table,
.round-results table,
.final-scorecard table,
.end-scorecard table,
.scorecard-final table,
#results table,
#roundResults table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed;
  border-collapse: collapse;
}

.result-card .scorecard-scroll,
.results-card .scorecard-scroll,
.round-results .scorecard-scroll,
.final-scorecard .scorecard-scroll,
.end-scorecard .scorecard-scroll,
.scorecard-final .scorecard-scroll,
#results .scorecard-scroll,
#roundResults .scorecard-scroll,
.scorecard-wrap,
.final-scorecard-wrap {
  overflow-x: visible !important;
  width: 100% !important;
  max-width: 100% !important;
}

.result-card th,
.result-card td,
.results-card th,
.results-card td,
.round-results th,
.round-results td,
.final-scorecard th,
.final-scorecard td,
.end-scorecard th,
.end-scorecard td,
.scorecard-final th,
.scorecard-final td,
#results th,
#results td,
#roundResults th,
#roundResults td {
  min-width: 0 !important;
  padding-left: .28rem !important;
  padding-right: .28rem !important;
  text-align: center;
  white-space: nowrap;
}

.result-card th:first-child,
.result-card td:first-child,
.results-card th:first-child,
.results-card td:first-child,
.round-results th:first-child,
.round-results td:first-child,
.final-scorecard th:first-child,
.final-scorecard td:first-child,
.end-scorecard th:first-child,
.end-scorecard td:first-child,
.scorecard-final th:first-child,
.scorecard-final td:first-child,
#results th:first-child,
#results td:first-child,
#roundResults th:first-child,
#roundResults td:first-child {
  width: 20%;
  text-align: left;
  padding-left: .45rem !important;
}

@media (max-width: 700px) {
  .result-card table,
  .results-card table,
  .round-results table,
  .final-scorecard table,
  .end-scorecard table,
  .scorecard-final table,
  #results table,
  #roundResults table {
    font-size: clamp(.68rem, 2.7vw, .9rem);
  }

  .result-card th,
  .result-card td,
  .results-card th,
  .results-card td,
  .round-results th,
  .round-results td,
  .final-scorecard th,
  .final-scorecard td,
  .end-scorecard th,
  .end-scorecard td,
  .scorecard-final th,
  .scorecard-final td,
  #results th,
  #results td,
  #roundResults th,
  #roundResults td {
    padding-left: .12rem !important;
    padding-right: .12rem !important;
  }
}

/* =========================================================
   FINAL SCORECARD POLISH v5 — TARGET THE ACTUAL SCORE CLASSES
   ========================================================= */

/*
 * The prior fix did not hit the actual .final-score-group wrapper.
 * Pinecrest added overflow-x:auto + min-width:620px there, which is
 * the scrollbar visible on the Round Complete screen.
 */

/* Use the available width of the end panel instead of the old 520px cap. */
.final-scores{
  width:100% !important;
  max-width:780px !important;
  margin:22px auto !important;
  overflow:visible !important;
}

/* Absolutely no horizontal scrolling on a completed-round scorecard. */
.final-score-group{
  width:100% !important;
  max-width:100% !important;
  overflow-x:hidden !important;
  overflow-y:visible !important;
  margin-top:12px;
}

/* Remove Pinecrest's old forced 620px minimum width. */
.final-score-group .score-table,
.final-score-table{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  table-layout:fixed !important;
  border-collapse:collapse;
}

/*
 * Player column gets enough room for "Wisco"/player names.
 * The remaining columns share the rest of the width.
 */
.final-score-table th:first-child,
.final-score-table td:first-child{
  width:20% !important;
  text-align:left !important;
  padding-left:.45rem !important;
}

/* Compact hole cells so 1–9 + subtotal fit comfortably. */
.final-score-table th:not(:first-child),
.final-score-table td:not(:first-child){
  width:auto !important;
  min-width:0 !important;
  padding-left:.18rem !important;
  padding-right:.18rem !important;
  text-align:center;
  white-space:nowrap;
}

/* Front 9 and Back 9 remain separate blocks on an 18-hole result. */
.end-panel .final-score-group + .final-score-group{
  margin-top:18px;
  padding-top:14px;
  border-top:1px solid rgba(255,255,255,.10);
}

@media(max-width:760px){
  .final-scores{
    max-width:100% !important;
    margin:16px auto !important;
  }

  .final-score-table{
    font-size:clamp(.64rem,2.35vw,.82rem) !important;
  }

  .final-score-table th:first-child,
  .final-score-table td:first-child{
    width:18% !important;
    padding-left:.2rem !important;
  }

  .final-score-table th:not(:first-child),
  .final-score-table td:not(:first-child){
    padding-left:.06rem !important;
    padding-right:.06rem !important;
  }
}

/* =========================================================
   FINAL RESULTS POLISH v6 — HOLE-IN-ONE BOARD SPACING
   ========================================================= */

.ace-board{
  width:min(100%,760px) !important;
  margin:28px auto 20px !important;
  padding:22px 26px 24px !important;
  border-radius:18px;
  text-align:center !important;
}

.ace-board-heading{
  display:block !important;
  margin:0 auto 18px !important;
  text-align:center !important;
}

.ace-board-heading > div{
  width:100%;
}

.ace-board .eyebrow{
  margin-bottom:5px;
  text-align:center;
}

.ace-board h3{
  margin:0 !important;
  text-align:center !important;
}

.ace-board-list{
  width:100%;
  max-width:680px;
  margin:0 auto;
  overflow-x:visible !important;
}

.ace-table{
  width:100% !important;
  margin:0 auto;
  border-collapse:collapse;
  table-layout:auto;
}

.ace-table th,
.ace-table td{
  padding:10px 12px !important;
  text-align:left;
  vertical-align:middle;
}

.ace-table th{
  padding-bottom:11px !important;
}

.ace-table td:nth-child(3),
.ace-table th:nth-child(3){
  text-align:center;
}

.end-actions{
  margin-top:24px !important;
}

@media(max-width:700px){
  .ace-board{
    width:100% !important;
    margin:20px auto 16px !important;
    padding:16px 14px 18px !important;
  }

  .ace-board-heading{
    margin-bottom:12px !important;
  }

  .ace-table{
    font-size:.74rem;
  }

  .ace-table th,
  .ace-table td{
    padding:8px 6px !important;
  }

  .end-actions{
    margin-top:18px !important;
  }
}

