/* ADHUNIK Computer Institute: header + footer.
   Normal screens: full header, footer at the bottom.
   Typing mode (body.playing): header shrinks to a small bar on the left reading "ACI Typing Master"; footer hidden. */
:root { --aci-h: 34px; }

/* ----- Header (normal): big ----- */
.aci-header {
  display: flex; align-items: center; justify-content: flex-start; gap: 16px;
  margin: -16px -16px 22px;
  padding: 26px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--glassb);
  box-shadow: 0 2px 14px var(--shadow);
  position: relative; z-index: 3;
}
.aci-logo-img { height: 64px; width: auto; flex: none; }
.aci-name b { display: block; font-size: clamp(26px, 7.5vw, 40px); font-weight: 800; letter-spacing: .14em; line-height: 1.1; color: var(--ink); }
.aci-name small { display: block; margin-top: 4px; font-size: clamp(12px, 3.2vw, 16px); font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); }
.aci-short { display: none; font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: .2px; }
@media (min-width: 700px) { .aci-header { justify-content: center; } }

/* ----- Footer (normal) ----- */
body { padding-bottom: 112px; }
.aci-footer {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--card);
  border-top: 1px solid var(--glassb);
  box-shadow: 0 -2px 14px var(--shadow);
  text-align: center;
}
.aci-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.aci-btn {
  display: inline-block; padding: 9px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--ink); background: var(--btn-bg); border: 1px solid var(--btn-bd);
  box-shadow: 0 2px 6px var(--shadow); transition: all .2s ease;
}
.aci-btn:hover { border-color: var(--accent); background: var(--btn-hover); transform: translateY(-2px); }
.aci-btn.main { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); border-color: #1e40af; color: #fff; }
.aci-btn.main:hover { background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%); }
.aci-footer small { display: block; margin-top: 8px; font-size: 12px; color: var(--mute); }

/* ----- Typing mode: small left header, no footer ----- */
:is(body.playing, body:has(#app.play)) .aci-header {
  height: var(--aci-h); margin: -10px -18px 0; padding: 0 14px; gap: 8px; border-bottom: 1px solid var(--glassb);
  justify-content: flex-start; box-shadow: none;
}
:is(body.playing, body:has(#app.play)) .aci-logo-img { height: 22px; }
:is(body.playing, body:has(#app.play)) .aci-full { display: none; }
:is(body.playing, body:has(#app.play)) .aci-short { display: inline; animation: aciIn .3s ease; }
:is(body.playing, body:has(#app.play)) .aci-footer { display: none; }
@keyframes aciIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

/* the typing screen is now shorter by the header height */
:is(body.playing, body:has(#app.play)) #app.play {
  height: calc(100vh - var(--aci-h) + 10px);
  height: calc(100dvh - var(--aci-h) + 10px);
}

/* ----- Home page: keyboard that types "Adhunik.Prabh" in a loop ----- */
.hk-wrap { max-width: 640px; margin: 36px auto 0; }
.hk-text {
  min-height: 76px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; padding: 8px 16px;
  background: var(--panel); border: 2px solid var(--glassb); border-radius: 16px;
  box-shadow: inset 0 2px 8px var(--shadow);
  font: 700 clamp(20px, 5.4vw, 32px)/1.25 ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: .03em; color: var(--ink); text-align: center; overflow-wrap: anywhere;
}
.hk-caret { display: inline-block; width: 3px; height: 1.1em; margin-left: 3px; background: var(--accent); animation: hkBlink 1s steps(1) infinite; }
@keyframes hkBlink { 50% { opacity: 0; } }
.hk-kb { display: flex; flex-direction: column; gap: 7px; }
.hk-row { display: flex; gap: 7px; justify-content: center; }
.hk-row.r2 { padding: 0 4%; }
.hk {
  flex: 1; min-width: 0; height: 40px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--ink);
  background: var(--kbn); border: 1px solid var(--kbb);
  box-shadow: 0 3px 0 var(--kbb);
  transition: transform .08s ease, box-shadow .08s ease, background .08s ease, color .08s ease;
}
.hk.wide { flex: 1.7; font-size: 11px; color: var(--mute); }
.hk.space { flex: 0 0 56%; }
.hk.press {
  background: var(--accent); border-color: var(--accent2); color: #fff;
  transform: translateY(3px); box-shadow: 0 0 16px var(--glow);
}
@media (max-width: 560px) {
  .hk { height: 33px; font-size: 12px; border-radius: 7px; }
  .hk-kb, .hk-row { gap: 5px; }
  .hk.wide { font-size: 9px; }
}

/* ----- Header tools: theme toggle + sound toggle ----- */
.aci-tools { position: absolute; right: 16px; bottom: 14px; display: flex; gap: 8px; }
.aci-header .aci-ic {
  width: 40px; height: 40px; padding: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); background: var(--btn-bg); border: 1px solid var(--btn-bd);
}
.aci-header .aci-ic svg { display: block; }
.aci-header .aci-ic.off { color: var(--mute); }
:is(body.playing, body:has(#app.play)) .aci-tools { top: 50%; bottom: auto; right: 12px; transform: translateY(-50%); gap: 6px; }
:is(body.playing, body:has(#app.play)) .aci-header .aci-ic { width: 26px; height: 26px; border-radius: 8px; box-shadow: none; }
:is(body.playing, body:has(#app.play)) .aci-header .aci-ic svg { width: 15px; height: 15px; }
