:root{
  --bg:#000;
  --fg:#fff;
  --muted: rgba(255,255,255,0.72);
  --muted2: rgba(255,255,255,0.46);

  --card: rgba(255,255,255,0.06);
  --card2: rgba(255,255,255,0.12);

  --radius: 20px;
  --orp: #ff3b30;

  --maxw: 720px;
}

*{ box-sizing:border-box; }
html,body{
  height:100%;
  margin:0;
  background:var(--bg);
  color:var(--fg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}
a{ color:var(--fg); text-decoration:none; }
button, input, select{ font:inherit; }
button{ -webkit-tap-highlight-color: transparent; }

.app{
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 28px 18px;
}

.screen{
  width: min(var(--maxw), 100%);
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.04));
  border: 1px solid var(--card2);
  border-radius: var(--radius);
  padding: 20px;
}

.brand{
  font-size: 13px;
  color: var(--muted2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.h1{
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 8px 0 10px;
}

.p{
  margin: 0;
  line-height: 1.55;
  color: var(--muted);
}

.small{ font-size: 13px; color: var(--muted2); }
.spacer{ height: 16px; }
.spacerLg{ height: 22px; }

.primary{
  width:100%;
  border:0;
  border-radius: 999px;
  padding: 15px 18px;
  background: #fff;
  color: #000;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor:pointer;
}

.secondary{
  width:100%;
  border: 1px solid var(--card2);
  border-radius: 999px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.03);
  color: #fff;
  cursor:pointer;
}

.btnRow{
  display:flex;
  gap: 10px;
}
.btnSmall{
  flex:1;
  border: 1px solid var(--card2);
  border-radius: 999px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  color:#fff;
  cursor:pointer;
  text-align:center;
  font-weight: 600;
}

.ghost{
  border:0;
  background: transparent;
  color: var(--muted);
  padding: 12px 0;
  cursor:pointer;
}

.row{
  display:flex;
  gap: 12px;
  align-items:center;
  justify-content:space-between;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  padding: 8px 12px;
  border-radius: 999px;
  color: rgba(255,255,255,0.72);
  font-size: 13px;
}

.kbdHint{
  margin-top: 10px;
  color: var(--muted2);
  font-size: 13px;
}

/* Logo on main menu */
.logoWrap{
  display:flex;
  justify-content:center;
  margin-bottom: 10px;
}
.logoIcon{
  width: 78px;
  height: 78px;
  border-radius: 22px;
  box-shadow: 0 14px 36px rgba(0,0,0,0.5);
}

/* Picker UI */
.search{
  width: 100%;
  border-radius: 999px;
  padding: 14px 14px;
  border: 1px solid var(--card2);
  background: rgba(0,0,0,0.25);
  color: #fff;
  outline: none;
}
.search::placeholder{ color: rgba(255,255,255,0.35); }

.list{
  display:flex;
  flex-direction: column;
  gap: 10px;
}
.listItem{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid var(--card2);
  background: rgba(255,255,255,0.04);
  cursor:pointer;
}
.listItem:active{ transform: scale(0.995); }

.grid{
  display:grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 520px){ .grid{ grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 420px){ .grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.chip{
  border: 1px solid var(--card2);
  background: rgba(255,255,255,0.04);
  color: #fff;
  border-radius: 14px;
  padding: 12px 0;
  text-align:center;
  cursor:pointer;
  user-select:none;
}
.chip.active{ background: rgba(255,255,255,0.10); }

/* Reader stage */
.wordStage{
  position: fixed;
  inset: 0;
  background: #000;
  display:flex;
  align-items:center;
  justify-content:center;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
}

/* Focus box */
.wordStage::before{
  content:"";
  position:absolute;
  width: min(760px, 92vw);
  height: 190px;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.03) inset;
  border-radius: 18px;
}

/* Horizontal guide line */
.wordStage::after{
  content:"";
  position:absolute;
  width: min(760px, 92vw);
  border-top: 1px solid rgba(255,255,255,0.10);
  opacity: 0.9;
}

/* Center focus line split (stops short of ORP) */
.focusLineTop,
.focusLineBottom{
  position:absolute;
  left: 50%;
  transform: translateX(-0.5px);
  width: 0;
  border-left: 1px solid rgba(255,255,255,0.16);
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.08));
  pointer-events:none;
}
.focusLineTop{
  top: calc(50% - 140px);
  height: 86px;
}
.focusLineBottom{
  top: calc(50% + 54px);
  height: 86px;
}

/* Optional subtle vertical ticks */
.tickLeft, .tickRight{
  position:absolute;
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,0.10);
  top: 50%;
  transform: translateY(-50%);
}
.tickLeft{ left: calc(50% - min(380px, 46vw)); }
.tickRight{ left: calc(50% + min(380px, 46vw)); }

/* ORP layout */
.word{
  position: relative;
  width: min(760px, 92vw);
  min-height: 1.5em;
  font-size: clamp(44px, 7vw, 80px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: visible;
}
.word .orp{
  position:absolute;
  left:50%;
  transform: translateX(-50%);
  color: var(--orp);
  white-space: nowrap;
}
.word .left{
  position:absolute;
  right:50%;
  padding-right: 0.3ch;
  white-space: nowrap;
  text-align: right;
  max-width: 45vw;
  overflow: visible;
}
.word .right{
  position:absolute;
  left:50%;
  padding-left: 0.3ch;
  white-space: nowrap;
  text-align: left;
  max-width: 45vw;
  overflow: visible;
}

/* Bottom verse pill */
.readerBottom{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  display:flex;
  justify-content:center;
  pointer-events:none;
}
.readerBottom .pill{
  pointer-events:none;
  backdrop-filter: blur(10px);
}

/* Pause overlay */
.pauseOverlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.66);
  backdrop-filter: blur(6px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 20px;
}
.pauseCard{
  width: min(540px, 92vw);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.05));
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 22px;
  padding: 18px;
}
.pauseTitle{
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin: 0 0 10px;
}

.toast{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 86px;
  display:flex;
  justify-content:center;
  pointer-events:none;
}
.toast .pill{
  pointer-events:none;
}

.offlineBanner{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255,59,48,0.15);
  border-bottom: 1px solid rgba(255,59,48,0.3);
  backdrop-filter: blur(10px);
  padding: 10px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  z-index: 9999;
}
