/* css/croakbeat.css */
.cb-root {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 540px;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #e6f9ed;
  background: #031208;
  display: flex;
  flex-direction: column;
}

.cb-canvas-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.cb-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10;
  padding: 10px 14px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(3,18,8,0.85) 0%, rgba(3,18,8,0) 100%);
}

.cb-hud-left, .cb-hud-center, .cb-hud-right {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cb-hud-center {
  align-items: center;
}

.cb-hud-right {
  align-items: flex-end;
}

.cb-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #72af85;
}

.cb-value {
  font-size: 18px;
  font-weight: 900;
  color: #e8fbee;
  text-shadow: 0 0 8px rgba(0, 255, 128, 0.35);
  font-variant-numeric: tabular-nums;
}

.cb-hp-wrap {
  width: 120px;
  height: 10px;
  background: rgba(8, 38, 18, 0.8);
  border: 1px solid #1f6b3a;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.7);
}

.cb-hp-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #10b981, #00ff73);
  box-shadow: 0 0 10px #00ff73;
  transition: width 0.12s ease-out, background 0.2s ease;
}

.cb-hp-danger {
  background: linear-gradient(90deg, #dc2626, #f87171) !important;
  box-shadow: 0 0 10px #f87171 !important;
}

.cb-hyper-wrap {
  position: absolute;
  bottom: 82px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: auto;
}

.cb-hyper-btn {
  background: #062312;
  border: 1.5px solid #1d7942;
  color: #a7dfb8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  transition: all 0.15s ease;
}

.cb-hyper-btn.cb-ready {
  background: #00e676;
  border-color: #ffffff;
  color: #03200d;
  box-shadow: 0 0 18px #00ff77, 0 0 30px rgba(0, 255, 119, 0.45);
  animation: cb-hyper-pulse 1s infinite alternate ease-in-out;
}

.cb-hyper-btn:active {
  transform: scale(0.95);
}

@keyframes cb-hyper-pulse {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.07); filter: brightness(1.2); }
}

.cb-hyper-meter-track {
  width: 110px;
  height: 5px;
  background: rgba(6, 32, 16, 0.75);
  border-radius: 3px;
  overflow: hidden;
  border: 0.5px solid rgba(43, 143, 80, 0.5);
}

.cb-hyper-meter-bar {
  width: 0%;
  height: 100%;
  background: #00ff88;
  box-shadow: 0 0 6px #00ff88;
  transition: width 0.1s linear;
}

.cb-lanes-input {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 90px;
  display: flex;
  z-index: 15;
  pointer-events: auto;
}

.cb-touch-lane {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 10px;
  border-right: 1px solid rgba(34, 110, 61, 0.25);
  cursor: pointer;
  touch-action: manipulation;
  background: rgba(4, 25, 13, 0.1);
  transition: background 0.08s ease;
}

.cb-touch-lane:last-child {
  border-right: none;
}

.cb-touch-lane.cb-pressed {
  background: linear-gradient(0deg, rgba(0, 255, 119, 0.35) 0%, rgba(0, 255, 119, 0) 100%);
}

.cb-key-badge {
  font-size: 13px;
  font-weight: 800;
  color: #92e0ab;
  background: rgba(5, 36, 17, 0.7);
  border: 1px solid #1a6d3a;
  border-radius: 6px;
  padding: 3px 8px;
  pointer-events: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.cb-touch-lane.cb-pressed .cb-key-badge {
  background: #00ff77;
  color: #03200f;
  border-color: #ffffff;
  box-shadow: 0 0 8px #00ff77;
}

.cb-modal-layer {
  position: absolute;
  inset: 0;
  background: rgba(3, 16, 8, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  box-sizing: border-box;
}

.cb-modal-card {
  width: 100%;
  max-width: 360px;
  background: #072314;
  border: 1.5px solid #1f6b39;
  border-radius: 16px;
  padding: 20px 22px;
  box-sizing: border-box;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65), 0 0 24px rgba(0, 255, 119, 0.1);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cb-modal-header {
  text-align: center;
}

.cb-title {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #e5fbee;
  text-shadow: 0 0 12px rgba(0, 255, 119, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cb-subtitle {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #79ba8e;
}

.cb-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #8be0a5;
  margin-bottom: 6px;
}

.cb-track-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cb-track-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #092f1b;
  border: 1px solid #17542d;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cb-track-item.cb-active {
  background: #0f4829;
  border-color: #00ff73;
  box-shadow: 0 0 10px rgba(0, 255, 115, 0.25);
}

.cb-track-name {
  font-weight: 800;
  font-size: 14px;
  color: #edfdf2;
}

.cb-track-meta {
  font-size: 11px;
  color: #7ab98f;
  margin-top: 2px;
}

.cb-track-best {
  text-align: right;
  font-size: 11px;
  font-weight: 700;
}

.cb-grade-badge {
  display: inline-block;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  background: #051d10;
  color: #00ff73;
  border: 1px solid #00ff73;
  margin-left: 4px;
}

.cb-diff-selector {
  display: flex;
  background: #041d0f;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #15552b;
}

.cb-diff-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: #7ab88e;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cb-diff-btn.cb-active {
  background: #146134;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.cb-btn-start {
  background: #00e676;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #02200e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.5);
  transition: transform 0.1s ease, filter 0.1s ease;
}

.cb-btn-start:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.cb-btn-start:active {
  transform: translateY(1px);
}

.cb-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #051e10;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #14552b;
}

.cb-res-item {
  display: flex;
  flex-direction: column;
}

.cb-res-val {
  font-size: 18px;
  font-weight: 800;
  color: #edfdf3;
}

.cb-res-grade-big {
  grid-column: span 2;
  text-align: center;
  padding: 6px;
  font-size: 40px;
  font-weight: 900;
  color: #00ff77;
  text-shadow: 0 0 18px #00ff77;
}

.cb-top-actions {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 20;
  display: flex;
  gap: 8px;
}

.cb-btn-icon {
  background: rgba(5, 34, 16, 0.75);
  border: 1px solid #1c6d3b;
  color: #c9eed5;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.cb-hyper-active-border {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 18;
  box-shadow: inset 0 0 25px #00ff77, inset 0 0 50px rgba(0, 255, 119, 0.4);
  animation: cb-warp-glow 0.8s infinite alternate ease-in-out;
}

@keyframes cb-warp-glow {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}
