/* TIPITY Bible — polished, scrollable, ad dock ready */
:root{
  --bg1:#001233;
  --bg2:#002855;
  --accent:#00b4d8;
  --accent2:#90e0ef;
  --fg:#e0fbfc;
  --glass: rgba(255,255,255,0.10);
  --glass-strong: rgba(255,255,255,0.18);
  --shadow: 0 20px 40px rgba(0,0,0,.35);
  --radius: 16px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji','Segoe UI Emoji', 'Segoe UI Symbol';
  color:var(--fg);
  background: radial-gradient(1200px 800px at 20% -10%, #13324d 0%, #0d1b2a 60%) fixed;
  background-attachment: fixed;
  display:flex; flex-direction:column; min-height:100vh;
}
.app-header{
  padding: clamp(.75rem, 1.5vw, 1rem);
  display:flex; align-items:center; justify-content:space-between;
  backdrop-filter: blur(6px);
  background: linear-gradient(180deg,#00b4d8,#0077b6);
  position:sticky; top:0; z-index:10; border-bottom:1px solid rgba(255,255,255,.08);
}
h1{margin:0; font-weight:800; letter-spacing:.5px;}
.top-actions{display:flex; align-items:center; gap:.5rem;}
.voice-label{opacity:.85}
#voiceSelect{
  max-width: min(60vw, 320px);
  padding:.55rem .7rem; border-radius:10px; border:1px solid rgba(255,255,255,.2);
  background:var(--glass); color:var(--fg);
}
.app-main{flex:1; padding: 1rem; display:flex; flex-direction:column; gap:1rem;}
.card{ background:var(--glass); border:1px solid rgba(255,255,255,.16); border-radius:var(--radius); box-shadow: var(--shadow); }
.verse-card{padding:.75rem;}
#verseDisplay{
  width:100%; height:42vh; resize:none; border:0; outline:0;
  background:transparent; color:var(--fg);
  font-size: clamp(1rem, 1.8vw, 1.1rem); line-height: 1.55;
}
.controls{display:flex; flex-direction:column; gap:.6rem;}
.row{display:flex; gap:.5rem; flex-wrap:wrap; align-items:center; justify-content:center;}
.ref-input{
  flex:1; min-width:260px;
  padding:.9rem 1rem; border-radius:12px; border:1px solid rgba(255,255,255,.18);
  background:var(--glass-strong); color:var(--fg);
  box-shadow: var(--shadow);
}
.btn{
  padding:.85rem 1.1rem; border:0; border-radius:14px; cursor:pointer;
  color:#0b132b; background:linear-gradient(180deg,#00b4d8,#0077b6);
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
  font-weight:700; letter-spacing:.2px;
  transition: transform .04s ease, filter .2s ease, box-shadow .2s ease;
}
.btn:hover{filter:brightness(1.06); box-shadow: 0 16px 30px rgba(0,0,0,.35);}
.btn:active{ transform: translateY(1px) scale(.995); }
.btn.primary{background:linear-gradient(180deg,#00b4d8,#0077b6);}
.btn.success{background:linear-gradient(180deg,#00b4d8,#0077b6);}
.btn.danger{background:linear-gradient(180deg,#00b4d8,#0077b6); color:#361818;}
.hold{ position:relative; }
.hold .mic{font-size:1.1rem; margin-right:.4rem;}
.hold.listening{ box-shadow: 0 0 0 6px rgba(255,209,102,.15), var(--shadow); }
.hold.listening::after{
  content:""; position:absolute; inset:-6px; border-radius:20px;
  border:2px dashed rgba(255,209,102,.5); animation:pulse 1.2s linear infinite;
}
@keyframes pulse{ 0%{opacity:0; transform:scale(.95)} 50%{opacity:1} 100%{opacity:0; transform:scale(1.05)} }
.status{ text-align:center; opacity:.85; min-height:1.2em; }
.help summary{cursor:pointer; opacity:.9}
.help{opacity:.85}
.app-footer{ margin-top:auto; }

/* --- Reserved, safe-area-aware fixed ad dock --- */
body.hasAdDock{ 
  padding-bottom: calc(60px + env(safe-area-inset-bottom)); 
}
@supports(padding: max(0px)){
  body.hasAdDock{ padding-bottom: max(60px, 60px + env(safe-area-inset-bottom)); }
}
#adDock{
  position: fixed; 
  left: 0; right: 0; bottom: 0; 
  height: 60px;
  display:flex; align-items:center; justify-content:center;
  background: rgba(0,0,0,.35);
  border-top:1px solid rgba(255,255,255,.18);
  box-shadow: 0 -12px 24px rgba(0,0,0,.25);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 2147483647;
}

#adDock span{opacity:.8}
.legal{ text-align:center; padding:.6rem; opacity:.9; }
.linklike{ background:none; border:none; color:var(--fg); text-decoration:underline; cursor:pointer; }
.legal a{ color:var(--fg); }


/* Edge-to-edge, single-screen lock */
html, body { height: 100dvh; overflow: hidden; }
body { overscroll-behavior: none; touch-action: manipulation; }
main { height: calc(100dvh - 120px); overflow: hidden; display: flex; flex-direction: column; }
#verseDisplay { flex: 1 1 auto; overflow: auto; }


/* Single-screen lock improvements */
html, body { height: 100dvh; overflow: hidden; }
body { display: grid; grid-template-rows: auto 1fr auto; overscroll-behavior: none; touch-action: manipulation; }
main { display: flex; flex-direction: column; min-height: 0; }
#verseDisplay { flex: 1 1 auto; min-height: 0; overflow: auto; }
.top-actions, .controls { flex: 0 0 auto; }

/* Ensure legal links above banner ad */
.legal{
  position: fixed;
  bottom: 60px; /* sits just above 60px ad dock */
  left: 0; right: 0;
  text-align: center;
  padding: 0.4rem;
  background: rgba(0,0,0,0.25);
  z-index: 2147483646;
}
