* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #06110b; /* deep forest green */
  color: #f9f5e6;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Canvas fills behind UI */
#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* UI layer overlays canvas */
#ui-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  pointer-events: none; /* enable selective click-through */
}

/* Generic screen container */
.screen {
  pointer-events: auto;
  margin: auto;
  width: 100%;
  height: 100%;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Panels */
.panel {
  background: rgba(10, 26, 17, 0.96);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  padding: 16px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.title-main {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fef4d1;
}

.title-sub {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: #d6e8d9;
}

.chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fdf9ea;
}

/* Buttons */
.button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #1e3c25;
  color: #fdf9ea;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.btn span.small {
  font-size: 11px;
  text-transform: none;
  opacity: 0.8;
  letter-spacing: 0;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.18), transparent 55%);
  opacity: 0;
  transition: opacity 120ms ease-out;
}

.btn:active::before {
  opacity: 1;
}

.btn-primary {
  background: linear-gradient(135deg, #cb252b, #f24433);
}

.btn-secondary {
  background: #173420;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(249, 245, 230, 0.4);
  box-shadow: none;
}

.btn-pill {
  border-radius: 999px;
}

/* Small info text row */
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #e0ebdd;
}

/* Tag list */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(249, 245, 230, 0.05);
  color: #f6efe0;
  border: 1px solid rgba(249, 245, 230, 0.05);
}

/* List of items (songs / difficulties) */
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.list-item {
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(7, 20, 12, 0.92);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.list-item-main {
  display: flex;
  flex-direction: column;
}

.list-title {
  font-size: 13px;
  font-weight: 600;
  color: #fdf9ea;
}

.list-sub {
  font-size: 11px;
  color: #d2e3d5;
}

.list-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.pill {
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(249, 245, 230, 0.4);
  color: #fdf9ea;
}

.pill-soft {
  border: none;
  background: rgba(249, 245, 230, 0.08);
}

/* Bottom bar on screens */
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

/* Gameplay HUD */
.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fefaf0;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.hud-song {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-song-title {
  font-weight: 600;
}

.hud-song-artist {
  opacity: 0.75;
}

.hud-score {
  text-align: right;
}

.hud-score-main {
  font-weight: 700;
  font-size: 16px;
}

.hud-score-sub {
  font-size: 11px;
  opacity: 0.85;
}

.hud-center {
  align-self: center;
  text-align: center;
  font-size: 12px;
}

.judgement-text {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(0,0,0,0.7);
}

.judgement-perfect {
  color: #ffe29b;
}

.judgement-great {
  color: #c0f6d0;
}

.judgement-good {
  color: #b0d7ff;
}

.judgement-miss {
  color: #ff8da1;
}

/* Health bar */
.health-bar-container {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.health-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f24433, #ffd67a);
  transition: width 100ms linear;
}

/* Hit line indicator */
.hud-bottom {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Results */
.results-main {
  text-align: center;
  margin-top: 6px;
}

.results-score {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.results-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  opacity: 0.9;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.results-stat {
  background: rgba(7, 19, 12, 0.9);
  border-radius: 10px;
  padding: 8px 8px 7px;
}

.results-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.8;
}

.results-stat-value {
  font-size: 14px;
  font-weight: 700;
  margin-top: 2px;
}

/* Touch lanes overlay */
.touch-lanes {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: stretch;
  pointer-events: none;
}

.touch-lane {
  flex: 1;
  height: 36%;
  pointer-events: auto;
}

/* Small "back" button */
.back-btn {
  font-size: 11px;
  padding: 6px 10px;
}

/* Utility */
.hidden {
  display: none !important;
}

