:root{
  --bg:#f2eadc;
  --paper:#fbf7ef;
  --paper-2:#f6efdf;
  --ink:#0f2d4e;
  --muted:#6f6b63;
  --gold:#c89b4d;
  --gold-soft:#e6c98f;
  --line:#dcccb2;
  --navy:#112f53;
  --navy-2:#193d67;
  --sand:#e9dcc4;
  --danger:#b96558;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color:var(--ink);
  background:var(--bg);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  min-height:100vh;
  color:var(--ink);
  background:
    radial-gradient(circle at top, rgba(255,255,255,.55), transparent 26%),
    linear-gradient(180deg,#f9f2e6 0%, #f0e6d8 100%);
}
img{max-width:100%;display:block}
button,input{font:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.45}
.hidden{display:none!important}
.app-shell{max-width:920px;margin:0 auto;padding:0 18px 42px}
.topbar{
  height:52px;display:flex;align-items:center;justify-content:space-between;
  color:#5f6b73;font-size:11px;letter-spacing:.05em;
}
.brand-inline{display:flex;align-items:center;gap:10px;font-weight:800;min-width:0}
.brand-seal{width:24px;height:24px;border-radius:50%;background:linear-gradient(145deg,#fff8eb,#eadfc7);border:1px solid var(--line);display:grid;place-items:center;color:var(--gold);box-shadow:0 4px 10px rgba(60,45,20,.08);flex:none}
.brand-inline strong{font-size:14px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar-right{display:flex;align-items:center;gap:8px;color:#7a7a74;font-weight:700;flex:none}
.sync-dot,.tiny-dot{width:9px;height:9px;border-radius:50%;display:inline-block;background:#c9c8c2;box-shadow:0 0 0 3px rgba(255,255,255,.35)}
.sync-dot.online,.tiny-dot{background:#74b46d}.sync-dot.offline{background:#cc7c61}
.hero{
  position:relative;overflow:hidden;border-radius:26px;padding:14px 18px 14px;
  min-height:180px;margin-bottom:16px;
  background:
    linear-gradient(180deg, rgba(13,23,36,.14), rgba(13,23,36,.36)),
    url('kj-boule-hero.webp') center/cover no-repeat;
  box-shadow:0 16px 34px rgba(41,31,14,.18);
}
.hero::after{
  content:"";position:absolute;inset:auto 0 0 0;height:66px;
  background:linear-gradient(180deg, rgba(242,234,220,0), rgba(242,234,220,.88) 70%, rgba(242,234,220,1));
}
.hero-inner{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;text-align:center;color:#fff}
.hero-logo{width:min(170px,42%);filter:drop-shadow(0 8px 14px rgba(0,0,0,.26));margin-top:0}
.hero-copy{margin-top:6px}
.hero h1,.save-title h2,.history-header h2{font-family: Georgia, 'Times New Roman', serif;letter-spacing:-.03em}
.hero h1{font-size:clamp(26px,3.4vw,34px);line-height:1.02;margin:4px 0 4px;text-shadow:0 2px 12px rgba(0,0,0,.24)}
.subtitle{margin:0;color:#f2eadf;font-size:13px;font-weight:600}
.hero-chips{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin-top:12px}
.hero-chip{display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;background:rgba(255,248,234,.18);border:1px solid rgba(255,245,224,.28);backdrop-filter:blur(6px);min-width:112px;justify-content:center}
.hero-chip span{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#f7ebd9;font-weight:800}
.hero-chip strong{font-size:18px;font-family:Georgia,serif}
.tabs{
  display:grid;grid-template-columns:1fr 1fr;gap:10px;
  background:linear-gradient(180deg,var(--navy-2),var(--navy));
  border-radius:999px;padding:8px;box-shadow:0 14px 30px rgba(17,47,83,.18);
  margin:-24px auto 20px;max-width:860px;position:relative;z-index:2;
}
.tab{border:0;background:transparent;color:rgba(255,255,255,.72);padding:16px 18px;border-radius:999px;font-weight:800;font-size:18px;display:flex;align-items:center;justify-content:center;gap:10px}
.tab.active{background:linear-gradient(180deg,#fffaf0,#efe4cf);color:var(--ink);box-shadow:inset 0 0 0 1px rgba(200,155,77,.28),0 8px 18px rgba(0,0,0,.08)}
.tab-icon{width:24px;height:24px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:14px;background:rgba(255,255,255,.08)}
.tab.active .tab-icon{background:var(--navy);color:#f6e6c2}
.tab-count{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 8px;border-radius:999px;background:rgba(255,255,255,.12);font-size:12px}
.tab.active .tab-count{background:#ead3a4;color:var(--navy)}
.panel{background:rgba(255,250,244,.72);border:1px solid rgba(220,204,178,.55);border-radius:28px;padding:20px 18px 24px;box-shadow:0 18px 40px rgba(80,58,23,.07);backdrop-filter:blur(6px)}
.score-header,.history-header{display:flex;align-items:end;justify-content:space-between;gap:12px}
.score-header{font-size:11px;letter-spacing:.16em;text-transform:uppercase;color:#766f66;font-weight:800;margin:2px 4px 16px}
.score-live{display:flex;align-items:center;gap:8px;color:#8c887e}
.players{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.player-card{position:relative;overflow:hidden;padding:22px;border-radius:26px;background:linear-gradient(180deg,var(--paper),var(--paper-2));border:1px solid rgba(220,204,178,.9);box-shadow:0 14px 34px rgba(76,57,25,.08)}
.player-card::before,.player-card::after{content:"";position:absolute;border-radius:50%;opacity:.25;pointer-events:none}
.player-card::before{width:180px;height:180px;left:-95px;top:78px;border:18px solid #efe6d8}
.player-card::after{width:190px;height:190px;right:-115px;bottom:-70px;border:16px solid #f0e7d8}
.player-top{display:flex;flex-direction:column;align-items:center;text-align:center;position:relative;z-index:1}
.avatar{width:92px;height:92px;border-radius:50%;padding:4px;background:linear-gradient(180deg,#fffef8,#edd6a3);box-shadow:0 8px 18px rgba(38,31,18,.13);border:1px solid rgba(200,155,77,.28);margin-bottom:12px;overflow:hidden}
.avatar-inner{display:block;width:100%;height:100%;border-radius:50%;object-fit:cover;object-position:center}


.player-top h2{font-family:Georgia,'Times New Roman',serif;font-size:28px;margin:0 0 8px}

.player-divider{height:2px;width:120px;background:linear-gradient(90deg,transparent,var(--gold),transparent);margin:14px auto 12px}
.player-score{font-family:Georgia,'Times New Roman',serif;font-size:94px;line-height:.9;font-weight:700;color:var(--ink);margin-top:6px;font-variant-numeric:tabular-nums}
.controls{display:flex;justify-content:center;gap:24px;margin-top:18px;position:relative;z-index:1}
.score-btn{width:96px;height:96px;border-radius:50%;position:relative;overflow:hidden;border:1px solid rgba(200,155,77,.48);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;box-shadow:0 10px 22px rgba(67,54,28,.12);touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.hold-fill{position:absolute;inset:0;transform:scaleX(0);transform-origin:left center;pointer-events:none;transition:transform .04s linear}
.minus-btn{background:linear-gradient(180deg,#fbf5ea,#efe2cb);color:#b8822e}
.minus-btn .hold-fill{background:rgba(219,196,147,.55)}
.plus-btn{background:linear-gradient(180deg,#183d67,#0f2d4e);color:#f6d38a}
.plus-btn .hold-fill{background:rgba(255,255,255,.18)}
.score-btn.finished{box-shadow:0 0 0 4px rgba(200,155,77,.22),0 12px 24px rgba(40,29,9,.14)}
.btn-symbol{position:relative;z-index:1;font-size:52px;line-height:1;font-weight:400}
.btn-caption{position:relative;z-index:1;font-size:11px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:inherit;opacity:.78}
.helper{display:flex;gap:12px;align-items:flex-start;background:rgba(255,248,237,.92);border:1px solid rgba(220,204,178,.76);padding:14px 16px;border-radius:18px;color:#726758;font-size:14px;line-height:1.5;margin:18px 2px 22px}
.helper strong{color:#6a5129}
.helper-icon{width:24px;height:24px;flex:none;border-radius:50%;display:grid;place-items:center;background:#f6ebd6;color:#b17f34;font-weight:900}
.save-panel{background:linear-gradient(180deg,rgba(255,250,243,.95),rgba(246,239,223,.95));border:1px solid rgba(220,204,178,.88);border-radius:24px;padding:22px;display:grid;grid-template-columns:1.3fr .9fr;gap:18px;align-items:end}
.save-title h2{font-size:34px;margin:0 0 8px;color:var(--ink)}
.save-title p{margin:0;color:#756a5d;line-height:1.6;font-size:14px}
.date-field{display:flex;flex-direction:column;gap:8px;font-size:12px;letter-spacing:.08em;text-transform:uppercase;font-weight:800;color:#806d50}
.date-field input{border:1px solid rgba(200,155,77,.35);background:#fffef9;color:var(--ink);padding:14px 15px;border-radius:14px;min-width:0}
.actions{grid-column:1/-1;display:grid;gap:14px;margin-top:2px}
.action-divider{display:flex;align-items:center;gap:14px;justify-content:center;color:#c89b4d}
.action-divider::before,.action-divider::after{content:"";height:2px;flex:1;max-width:140px;background:linear-gradient(90deg,transparent,#d8b77b,transparent)}
.action-divider span{font-size:24px}
.save-button,.ghost-button{border-radius:20px;border:1px solid rgba(200,155,77,.46);min-height:72px;padding:0 24px;display:flex;align-items:center;justify-content:space-between;font-size:21px;font-weight:800;font-family:Georgia,serif}
.save-button{background:linear-gradient(180deg,var(--navy-2),var(--navy));color:#fff5df;box-shadow:0 14px 32px rgba(17,47,83,.18)}
.ghost-button{background:rgba(255,250,242,.94);color:var(--ink)}
.btn-main{display:flex;align-items:center;gap:14px}.btn-glyph{font-size:26px;color:#edcd89}.ghost-button .btn-glyph{color:var(--ink)}.btn-arrow{font-size:34px;line-height:1;color:#edcd89}.ghost-button .btn-arrow{color:var(--ink)}
.history-header{margin-bottom:18px}.history-header h2{font-size:34px;margin:8px 0 0}.history-total{font-size:13px;color:#82796d;font-weight:700}
.history-stats{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:18px}
.win-stat{padding:18px;background:linear-gradient(180deg,#fff9ee,#f2e6d0);border:1px solid rgba(220,204,178,.86);border-radius:20px;display:flex;justify-content:space-between;align-items:center;color:#6f624f;font-weight:800}
.win-stat strong{font-family:Georgia,serif;font-size:34px;color:var(--ink)}
.history-list{display:grid;gap:12px}
.history-entry{background:linear-gradient(180deg,#fffaf1,#f5e9d5);border:1px solid rgba(220,204,178,.84);border-radius:18px;padding:18px 18px;display:flex;align-items:center;gap:14px;box-shadow:0 10px 24px rgba(70,49,17,.06)}
.history-entry-main{flex:1;min-width:0}.history-entry-date{font-size:14px;font-weight:800;color:#364456}.history-entry-day{font-size:12px;color:#8c816f;margin-top:4px}.history-entry-winner{font-size:12px;color:#6c8452;margin-top:5px;font-weight:800}.history-entry-winner.draw{color:#9f8352}.history-entry-score{font-family:Georgia,serif;font-size:30px;color:var(--ink);white-space:nowrap;font-weight:700}
.delete-btn{border:0;background:transparent;color:#97726b;padding:8px 10px;font-size:26px;border-radius:12px}.delete-btn:hover{background:#f2dfd8;color:#ad5d4f}
.empty-history{background:linear-gradient(180deg,#fffaf1,#f5ebdb);border:1px dashed rgba(200,155,77,.45);border-radius:22px;text-align:center;padding:56px 20px;color:#7f7568}.empty-history .ball-icon{font-size:38px;display:block;margin-bottom:10px;color:#b88d44}.empty-history strong{display:block;color:var(--ink);font-size:20px;margin-bottom:10px;font-family:Georgia,serif}.empty-history p{margin:0 auto;max-width:320px;line-height:1.6}
footer{margin-top:26px;text-align:center;color:#9f8352;font-family:Georgia,serif;font-style:italic;font-size:26px}
.toast{position:fixed;bottom:calc(20px + env(safe-area-inset-bottom));left:50%;transform:translate(-50%,28px);min-width:240px;max-width:calc(100vw - 32px);padding:16px 20px;border-radius:16px;background:#153861;color:#fff9ef;font-size:14px;font-weight:800;text-align:center;box-shadow:0 18px 36px rgba(15,45,78,.28);opacity:0;pointer-events:none;transition:.22s;z-index:30}.toast.visible{opacity:1;transform:translate(-50%,0)}.toast.error{background:var(--danger)}
button:focus-visible,input:focus-visible{outline:3px solid rgba(200,155,77,.65);outline-offset:3px}
@media (max-width:760px){
  .app-shell{padding:0 14px 34px}
  .brand-inline strong{font-size:13px}
  .hero{padding:12px 14px 14px;min-height:164px;border-radius:22px}
  .hero-logo{width:min(148px,50%)}
  .hero h1{font-size:28px}
  .hero-chips{margin-top:10px}
  .tabs{margin-top:-18px;padding:6px;gap:6px}
  .save-panel{grid-template-columns:1fr}
  .player-score{font-size:84px}
  .save-title h2,.history-header h2{font-size:30px}
}
@media (max-width:560px){
  .topbar{height:48px;font-size:10px}
  .brand-inline{gap:8px}
  .brand-seal{width:22px;height:22px}
  .brand-inline strong{font-size:12px}
  .hero{min-height:150px;padding:10px 12px 14px}
  .hero-logo{width:min(132px,54%)}
  .hero h1{font-size:24px}
  .subtitle{font-size:12px}
  .players{grid-template-columns:1fr;gap:14px}
  .tab{padding:14px 10px;font-size:17px}
  .panel{padding:16px 14px 20px}
  .player-card{padding:18px}
  .controls{gap:18px}
  .score-btn{width:90px;height:90px}
  .btn-symbol{font-size:48px}
  .save-button,.ghost-button{font-size:19px;min-height:68px;padding:0 18px}
  footer{font-size:22px}
}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important}}

/* Compact club header: readable over the sandy background without masking the bottle. */
.hero{height:188px;min-height:0;padding:16px 22px;background:
  linear-gradient(90deg,rgba(12,28,48,.79) 0%,rgba(12,28,48,.54) 48%,rgba(12,28,48,.10) 100%),
  url('kj-boule-hero.webp') center center/cover no-repeat}
.hero::after{height:23px;background:linear-gradient(180deg,transparent,rgba(242,234,220,.44))}
.hero-inner{height:100%;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:18px;text-align:left}
.hero-logo{width:118px;height:auto;max-height:160px;object-fit:contain;flex:none;margin:0}
.hero-copy{margin:0}
.hero h1{font-size:clamp(25px,3.1vw,32px);margin:0 0 10px;max-width:340px}
.subtitle{font-size:13px}
@media(max-width:760px){.hero{height:168px;min-height:0;padding:13px 16px}.hero-logo{width:100px;max-height:145px}.hero-inner{gap:13px}.hero h1{font-size:27px}}
@media(max-width:560px){.hero{height:150px;min-height:0;padding:12px}.hero-logo{width:76px;max-height:125px}.hero-inner{gap:10px}.hero h1{font-size:23px;margin-bottom:6px}.subtitle{font-size:11px}}


/* Kompakter Club-Header: Status und Soundregler direkt im Bild statt eigener Leiste. */
.hero{margin-top:10px}
.hero-status{position:absolute;top:9px;right:10px;z-index:3;display:flex;align-items:center;gap:7px}
.hero-status .topbar-right{border-radius:999px;background:rgba(10,28,49,.6);color:#fff5dc;padding:7px 9px;font-size:10px;line-height:1;backdrop-filter:blur(5px)}
.hero-status .sync-dot{box-shadow:none;flex:none}
.sound-toggle{border:1px solid rgba(255,255,255,.24);border-radius:999px;width:32px;height:32px;display:grid;place-items:center;background:rgba(10,28,49,.6);color:white;font-size:15px;backdrop-filter:blur(5px)}
.sound-toggle[aria-pressed="false"]{opacity:.72}
.hero-copy{max-width:330px}
.hero h1{font-size:clamp(23px,2.7vw,29px);max-width:330px;line-height:1.08;margin:0;text-wrap:balance}
@media(max-width:760px){
 .hero{margin-top:7px}
 .hero-copy{max-width:240px}
 .hero h1{font-size:clamp(21px,3.5vw,26px);max-width:240px}
}
@media(max-width:560px){
 .hero-copy{max-width:195px}
 .hero h1{font-size:clamp(18px,5vw,22px);max-width:195px;line-height:1.07}
 .hero-status{top:5px;right:5px;gap:4px}
 .hero-status .topbar-right{font-size:9px;padding:6px}
 .sound-toggle{height:29px;width:29px;font-size:14px}
}
