/* Split the G — charte Guinness : noir / or / crème */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: radial-gradient(ellipse at 50% 30%, #17171a 0%, #0a0a0c 55%, #050506 100%);
  color: #f3e9d2;
  font-family: Georgia, 'Times New Roman', serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
}

header {
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 20px 6px;
  gap: 12px;
}

.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }

.brand img {
  height: clamp(22px, 5.5vw, 34px);
  width: auto;
  display: block;
  filter: drop-shadow(0 0 14px rgba(210, 162, 76, 0.25));
}

.tagline {
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(243, 233, 210, 0.55);
}

.headerRight {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

#best {
  font-size: 14px;
  color: rgba(243, 233, 210, 0.55);
  font-style: italic;
  white-space: nowrap;
}
#bestScore { color: #d2a24c; font-style: normal; }

.linkBtn {
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  background: transparent;
  color: rgba(243, 233, 210, 0.75);
  border: 1px solid rgba(210, 162, 76, 0.45);
  border-radius: 5px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.linkBtn:hover { color: #d2a24c; border-color: #d2a24c; }

.headerBtns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.iconBtn {
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 5px 9px;
  background: transparent;
  color: rgba(243, 233, 210, 0.75);
  border: 1px solid rgba(210, 162, 76, 0.45);
  border-radius: 5px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.iconBtn:hover { color: #d2a24c; border-color: #d2a24c; }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px 16px 20px;
}

#stage {
  position: relative;
  width: min(88vw, 380px);
}

#glass {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.6));
  transition: transform 0.2s;
}

#glass.tilt { animation: tilt 0.32s ease-in-out infinite alternate; }
#glass.tilt.surge { animation-duration: 0.12s; }

@keyframes tilt {
  from { transform: rotate(-1.1deg); }
  to   { transform: rotate(1.1deg); }
}

/* Bulles qui montent dans la bière */
.bub {
  fill: rgba(240, 230, 210, 0.28);
  animation: rise linear infinite;
}
@keyframes rise {
  0%   { transform: translateY(0);     opacity: 0; }
  10%  { opacity: 0.9; }
  85%  { opacity: 0.7; }
  100% { transform: translateY(-330px); opacity: 0; }
}

#hint {
  margin-top: 18px;
  font-style: italic;
  font-size: 15px;
  color: rgba(243, 233, 210, 0.6);
  text-align: center;
  min-height: 22px;
  transition: color 0.3s;
}
#hint.tense { color: #d2a24c; }

/* Overlay résultat */
#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 8, 0.72);
  backdrop-filter: blur(3px);
  border-radius: 12px;
  animation: fadeIn 0.35s ease-out;
}
#overlay[hidden] { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.card {
  text-align: center;
  padding: 28px 34px;
  background: rgba(12, 12, 14, 0.94);
  border: 1px solid rgba(210, 162, 76, 0.4);
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(210, 162, 76, 0.12);
  max-width: 86%;
}

#verdict {
  font-size: 17px;
  letter-spacing: 0.06em;
  color: rgba(243, 233, 210, 0.85);
  margin-bottom: 10px;
  min-height: 22px;
}

#score {
  font-size: 62px;
  line-height: 1;
  color: #d2a24c;
  text-shadow: 0 0 26px rgba(210, 162, 76, 0.45);
  font-variant-numeric: tabular-nums;
}

.scoreMax {
  color: rgba(243, 233, 210, 0.4);
  font-size: 15px;
  margin-top: 2px;
}

#distance {
  margin-top: 14px;
  font-size: 15px;
  font-style: italic;
  color: rgba(243, 233, 210, 0.7);
}

#replay {
  margin-top: 20px;
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 34px;
  background: transparent;
  color: #d2a24c;
  border: 1.5px solid #d2a24c;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
#replay:hover { background: #d2a24c; color: #0a0a0c; }

/* Envoi du score */
#submitRow {
  margin-top: 18px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

#pseudo {
  font-family: inherit;
  font-size: 15px;
  padding: 9px 12px;
  width: 150px;
  color: #f3e9d2;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(210, 162, 76, 0.4);
  border-radius: 6px;
  outline: none;
}
#pseudo:focus { border-color: #d2a24c; }
#pseudo::placeholder { color: rgba(243, 233, 210, 0.35); font-style: italic; }

#submitScore {
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.06em;
  padding: 9px 18px;
  background: transparent;
  color: #d2a24c;
  border: 1.5px solid #d2a24c;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
#submitScore:hover:not(:disabled) { background: #d2a24c; color: #0a0a0c; }
#submitScore:disabled { opacity: 0.45; cursor: default; }

#submitMsg {
  margin-top: 10px;
  min-height: 18px;
  font-size: 14px;
  font-style: italic;
  color: #d2a24c;
}

/* Classement */
#lbOverlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 8, 0.78);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.25s ease-out;
  padding: 20px;
}
#lbOverlay[hidden] { display: none; }

.lbCard { max-width: 420px; width: 100%; }

.lbTitle {
  font-size: 20px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #d2a24c;
  margin-bottom: 14px;
  text-align: center;
}

.lbScroll { max-height: 55vh; overflow-y: auto; }

#lbTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
#lbTable th {
  font-weight: normal;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(210, 162, 76, 0.65);
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(210, 162, 76, 0.3);
}
#lbTable td {
  padding: 7px 10px;
  color: rgba(243, 233, 210, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
#lbTable tr.top td { color: #d2a24c; }
#lbTable .lbScore { font-variant-numeric: tabular-nums; text-align: right; }
#lbTable .lbDate { font-size: 12px; color: rgba(243, 233, 210, 0.4); }
#lbTable .lbEmpty {
  text-align: center;
  font-style: italic;
  color: rgba(243, 233, 210, 0.5);
  padding: 18px 0;
}

#lbClose {
  margin-top: 16px;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 9px 26px;
  background: transparent;
  color: #d2a24c;
  border: 1.5px solid #d2a24c;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
#lbClose:hover { background: #d2a24c; color: #0a0a0c; }

footer {
  padding: 14px;
  font-size: 12px;
  font-style: italic;
  color: rgba(243, 233, 210, 0.3);
  text-align: center;
}

@media (max-height: 700px) {
  #stage { width: min(80vw, 320px); }
  #score { font-size: 50px; }
}
