/* ORBRISE - styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  background: #0b0d14;
  color: #f2ecdf;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  position: fixed; inset: 0;
}
#cv { position: absolute; inset: 0; display: block; }
.hidden { display: none !important; }

/* top bar */
#topbar {
  position: absolute; top: max(10px, env(safe-area-inset-top)); right: 12px;
  display: flex; gap: 8px; z-index: 30;
}
.pill {
  background: rgba(20, 22, 34, 0.72);
  border: 1px solid rgba(255, 179, 92, 0.45);
  color: #ffd9a8;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.pill:active { transform: scale(0.95); }

/* HUD */
#hud {
  position: absolute; top: max(10px, env(safe-area-inset-top)); left: 12px;
  z-index: 25; pointer-events: none;
}
#hudMain { display: flex; flex-direction: column; gap: 6px; }
#hudValueBox {
  display: flex; align-items: center; gap: 9px;
  background: rgba(15, 16, 26, 0.72);
  border: 1px solid rgba(255, 179, 92, 0.5);
  border-radius: 14px;
  padding: 6px 14px;
  backdrop-filter: blur(4px);
  width: fit-content;
}
#hudOrb {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #fff8e7 0%, #ffb64d 55%, #e2622b 100%);
  box-shadow: 0 0 12px rgba(255, 182, 77, 0.8);
  display: inline-block;
}
#hudValue { font-size: 26px; font-weight: 800; line-height: 1; color: #ffe9c9; }
#hudZone { font-size: 13px; font-weight: 600; color: #cfd6e4; opacity: 0.92; padding-left: 4px; }
#doorChip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(15, 16, 26, 0.72);
  border: 1px solid rgba(217, 83, 79, 0.7);
  border-radius: 12px;
  padding: 6px 12px;
  width: fit-content;
  backdrop-filter: blur(4px);
  transition: border-color 0.25s;
}
#doorChip.ok { border-color: rgba(63, 174, 106, 0.9); }
#doorLock {
  width: 14px; height: 12px; display: inline-block; position: relative;
  border: 2px solid #d9534f; border-radius: 2px;
}
#doorChip.ok #doorLock { border-color: #3fae6a; }
#doorLock::before {
  content: ''; position: absolute; top: -7px; left: 2px;
  width: 6px; height: 6px;
  border: 2px solid #d9534f; border-bottom: none;
  border-radius: 4px 4px 0 0;
}
#doorChip.ok #doorLock::before { border-color: #3fae6a; }
#doorNeed { font-weight: 800; font-size: 17px; color: #ffe9c9; }
#barWrap { width: 110px; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.14); overflow: hidden; }
#barFill { height: 100%; width: 0%; border-radius: 4px; background: linear-gradient(90deg, #ffb64d, #ffd166); transition: width 0.2s; }

/* toast */
#toast {
  position: absolute; left: 50%; top: 88px; transform: translateX(-50%) translateY(-8px);
  background: rgba(15, 16, 26, 0.85);
  border: 1px solid rgba(255, 179, 92, 0.55);
  color: #ffe9c9;
  padding: 9px 18px; border-radius: 12px;
  font-size: 15px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 40; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* screens */
.screen {
  position: absolute; inset: 0; z-index: 20;
  display: none; align-items: center; justify-content: center;
  background: rgba(8, 9, 16, 0.55);
  backdrop-filter: blur(3px);
  padding: 16px;
}
.screen.show { display: flex; }
.panel {
  background: rgba(17, 19, 31, 0.92);
  border: 1px solid rgba(255, 179, 92, 0.35);
  border-radius: 22px;
  padding: 26px 26px 20px;
  max-width: 560px; width: 100%;
  max-height: 92vh; overflow-y: auto;
  text-align: center;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}
.logo {
  font-size: 46px; letter-spacing: 4px; font-weight: 900; color: #ffd166;
  text-shadow: 0 0 24px rgba(255, 179, 92, 0.55);
}
.logo span { color: #ff8c42; }
.sub { color: #cfd6e4; font-size: 15px; margin: 8px 0 18px; }
h2 { color: #ffd166; font-size: 24px; margin-bottom: 12px; letter-spacing: 1px; }
button { font-family: inherit; cursor: pointer; }
.big, .mid, .zoneBtn {
  border: none; border-radius: 14px;
  color: #241405; font-weight: 800;
  background: linear-gradient(180deg, #ffcf6e, #ff9a3d);
  box-shadow: 0 4px 0 #b3541e, 0 8px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
.big { display: block; width: 100%; padding: 14px; font-size: 21px; margin-bottom: 12px; }
.mid { padding: 10px 18px; font-size: 15px; }
.row { display: flex; gap: 10px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }
.big:active, .mid:active, .zoneBtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b3541e; }
.dailyBest { color: #8fd8b4; font-size: 14px; font-weight: 700; min-height: 18px; margin-bottom: 4px; }
.zonesTitle { color: #9aa4b8; font-size: 13px; text-transform: uppercase; letter-spacing: 2px; margin: 10px 0 8px; }
#zoneGrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.zoneBtn { padding: 8px 4px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; align-items: center; border-radius: 12px; }
.zoneBtn .zn { font-size: 17px; }
.zoneBtn .zname { font-size: 10px; font-weight: 700; opacity: 0.85; line-height: 1.15; }
.zoneBtn.locked { background: #2a2d3c; color: #7d869c; box-shadow: none; border: 1px solid #3a3e52; }
.small { font-size: 14px; line-height: 1.5; color: #dfe4ee; margin-bottom: 12px; text-align: left; }
.dim { color: #9aa4b8; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.foot .pill { font-size: 13px; padding: 6px 12px; color: #cfd6e4; border-color: rgba(160, 170, 190, 0.35); }
.ver { color: #6c748c; font-size: 12px; letter-spacing: 1px; }

/* touch controls */
#touch { display: none; }
body.touch #touch {
  display: flex; position: absolute; inset: auto 0 0 0;
  justify-content: space-between; align-items: flex-end;
  padding: 0 18px calc(18px + env(safe-area-inset-bottom));
  z-index: 15; pointer-events: none;
}
.tcRow { display: flex; gap: 14px; pointer-events: auto; }
.tbtn {
  pointer-events: auto;
  width: 66px; height: 66px; border-radius: 50%;
  border: 2px solid rgba(255, 179, 92, 0.55);
  background: rgba(20, 22, 34, 0.55);
  color: #ffd9a8; font-size: 24px;
  backdrop-filter: blur(3px);
}
.tbtn.jump { width: 80px; height: 80px; font-size: 28px; }
.tbtn.on { background: rgba(255, 154, 61, 0.45); }

@media (max-width: 600px) {
  .logo { font-size: 38px; }
  #zoneGrid { grid-template-columns: repeat(4, 1fr); }
  #hudValue { font-size: 21px; }
  #barWrap { width: 80px; }
  .panel { padding: 20px 16px 16px; }
  #toast { font-size: 13px; top: auto; bottom: 130px; }
}
