/* ==========================================================================
   akuarium/akuarium.css — Pautan awam Akuarium LANGSUNG (27 Okt 2026, Standard Bhg 55.9)
   Rangka halaman = kedai/kedai.css (kepala, sidebar, nav bawah, .kd-sheet). Fail ini hanya bahagian Akuarium.
   Palet hijau (Bhg 50) — tiada biru UI; air tangki ialah dunia 3D (bukan warna UI).
   ========================================================================== */
.ak-utama { display: flex; flex-direction: column; gap: var(--gap); padding-top: var(--pad-atas); }
.ak-kad { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: var(--kad-pad); min-width: 0; }

/* kepala = kad (Bhg 47.26) */
.ak-kepala { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ak-tt { flex: 1 1 260px; min-width: 0; }
.ak-tt h1 { margin: 0; font-size: calc(22px * var(--fs-scale, 1)); line-height: 1.2; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ak-tt p { margin: 4px 0 0; color: var(--text-muted); font-size: .88rem; overflow-wrap: anywhere; }
.ak-langsung { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--radius-full); background: var(--danger-bg); color: var(--danger-text); font-size: .7rem; font-weight: 800; letter-spacing: .06em; }
.ak-langsung i { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: ak-denyut 1.4s ease-in-out infinite; }
@keyframes ak-denyut { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .ak-langsung i { animation: none; } }
.ak-alat { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ak-per { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--primary-bg); border: 1px solid var(--primary-bd); }
.ak-per button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: none; color: var(--primary-text); font: inherit; font-size: .84rem; font-weight: 800; cursor: pointer; line-height: 1.1; }
.ak-per button small { display: block; font-size: .64rem; font-weight: 600; opacity: .85; }
.ak-per button.on { background: var(--primary-dark); color: #fff; }
.ak-b { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--card); color: var(--text); font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none; }
.ak-b:hover { border-color: var(--primary); }
.ak-b svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.ak-b.utama { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.ak-b:disabled { opacity: .5; cursor: not-allowed; }

/* pemilih sekolah / kod / kelas */
.ak-pilih h2 { margin: 0 0 4px; font-size: 1rem; color: var(--text); }
.ak-pilih p { margin: 0 0 10px; color: var(--text-muted); font-size: .85rem; }
.ak-cari { display: flex; gap: 8px; }
.ak-cari input { flex: 1; min-width: 0; min-height: 40px; box-sizing: border-box; border: 1.5px solid var(--border); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 16px; background: var(--card); color: var(--text); }
.ak-cari input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.ak-sen-sek { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; margin-top: 10px; }
.ak-sek { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--card-2); color: var(--text); font: inherit; font-size: .86rem; font-weight: 600; text-align: left; cursor: pointer; }
.ak-sek:hover { border-color: var(--primary); }
.ak-sek span { min-width: 0; overflow-wrap: anywhere; }
.ak-sek small { flex: none; color: var(--text-muted); font-weight: 600; font-size: .74rem; }
.ak-cip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ak-cip button { min-height: 34px; padding: 0 12px; border-radius: var(--radius-full); border: 1.5px solid var(--primary-bd); background: var(--primary-bg); color: var(--primary-text); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.ak-cip button.on { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.ak-nota { margin: 0; font-size: .8rem; color: var(--text-muted); }
.ak-nota a { color: var(--primary-text); font-weight: 700; }
.ak-kosong { padding: 14px; text-align: center; color: var(--text-muted); font-size: .86rem; }

/* pentas 3D + kedudukan */
.ak-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: var(--gap); align-items: stretch; }
.ak-pentas { position: relative; min-height: 460px; height: calc(100vh - var(--kepala-h) - 210px); max-height: 760px; border-radius: var(--radius); overflow: hidden; background: radial-gradient(circle at 50% 30%, #0E7490, #06283D); box-shadow: var(--shadow-sm); }
.ak-3d { position: absolute; inset: 0; }
.ak-tiada { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: #CFFAFE; font-size: .9rem; }
.ak-ov { position: absolute; left: 8px; right: 8px; top: 8px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; pointer-events: none; }
.ak-ov > * { pointer-events: auto; }
.ak-ov-tt { min-width: 0; padding: 6px 10px; border-radius: 10px; background: rgba(2, 44, 34, .62); color: #fff; font-size: .78rem; font-weight: 600; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.ak-ov-tt b { display: block; font-size: .92rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ak-ov-tt span { display: block; opacity: .9; font-size: .7rem; }
.ak-zum { display: flex; flex-direction: column; gap: 4px; }
.ak-zum button { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: rgba(2, 44, 34, .62); color: #fff; cursor: pointer; }
.ak-zum button svg { width: 20px; height: 20px; fill: currentColor; }
.ak-pentas:fullscreen { border-radius: 0; max-height: none; height: 100%; }
.ak-pentas:fullscreen .ak-ov-tt b { font-size: 1.2rem; }

.ak-sisi { display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - var(--kepala-h) - 210px); min-width: 0; padding: 8px; }
.ak-tab { display: flex; gap: 4px; margin-bottom: 8px; }
.ak-tab button { flex: 1; min-height: 34px; border: 0; border-radius: 9px; background: var(--card-2); color: var(--text-muted); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.ak-tab button.on { background: var(--primary-dark); color: #fff; }
.ak-sen { flex: 1; overflow: auto; min-height: 0; }
.ak-r { display: grid; grid-template-columns: 26px 12px minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; min-height: 42px; padding: 4px 8px; margin-bottom: 4px; border: 0; border-radius: 9px; background: var(--card-2); color: var(--text); font: inherit; font-size: .85rem; text-align: left; cursor: pointer; }
.ak-r:hover { background: var(--primary-bg); }
.ak-r.saya { box-shadow: inset 3px 0 0 var(--accent); background: var(--accent-bg); }
.ak-r .no { font-weight: 800; color: var(--primary-text); text-align: center; }
.ak-r i { width: 12px; height: 12px; border-radius: 50%; }
.ak-r b { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.ak-r b small { display: block; font-weight: 500; color: var(--text-muted); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; }
.ak-r .m { font-weight: 800; text-align: right; }
.ak-r .m small { display: block; font-weight: 500; font-size: .66rem; color: var(--text-muted); }
.ak-h4 { margin: 10px 4px 6px; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-text); }
.ak-kp { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; padding: 6px 8px; margin-bottom: 4px; border-radius: 9px; background: var(--card-2); font-size: .82rem; color: var(--text); }
.ak-kp b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ak-kp .v { font-weight: 800; }
.ak-kp .v.l { color: var(--danger-text); }
.ak-kp small { grid-column: 1 / -1; color: var(--text-muted); font-size: .7rem; }

/* helaian Kongsi / info ikan (rangka .kd-sheet daripada kedai.css, Bhg 36) */
.kd-sheet .kd-tutup svg { fill: currentColor; }
.ak-qr { display: grid; place-items: center; margin: 6px 0; }
.ak-qr canvas, .ak-qr img { width: 200px; max-width: 70vw; height: auto; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.ak-pautan { display: flex; gap: 6px; margin: 8px 0; }
.ak-pautan input { flex: 1; min-width: 0; min-height: 40px; box-sizing: border-box; border: 1.5px solid var(--border); border-radius: 10px; padding: 0 10px; font: inherit; font-size: 14px; background: var(--card-2); color: var(--text); }
.ak-aksi { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; margin-top: 8px; }
.ak-st { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.ak-st div { background: var(--card-2); border-radius: 10px; padding: 8px; text-align: center; }
.ak-st b { display: block; font-size: 1.1rem; color: var(--text); }
.ak-st span { font-size: .72rem; color: var(--text-muted); }
.ak-sheet-isi p { margin: 6px 0 0; color: var(--text-muted); font-size: .84rem; }

/* tablet potret = telefon (Bhg 34) */
@media (max-width: 899px), (orientation: portrait) and (max-width: 1366px) {
    .ak-grid { grid-template-columns: minmax(0, 1fr); }
    .ak-pentas { height: 58vh; min-height: 320px; max-height: 620px; }
    .ak-sisi { max-height: none; }
    .ak-sen { max-height: 460px; }
    .ak-alat { width: 100%; }
    .ak-per { flex: 1 1 100%; }
    .ak-per button { flex: 1; padding: 0 6px; }
    .ak-alat .ak-b { flex: 1 1 0; }
}
@media (max-width: 420px) {
    .ak-tt h1 { font-size: calc(19px * var(--fs-scale, 1)); }
    .ak-cari { flex-wrap: wrap; }
    .ak-cari .ak-b { flex: 1 1 100%; }
}

/* ==========================================================================
   MOD HUD SENTUH (27 Okt 2026, pemilik): "saya nak di mobile, ianya akan fullscreen landskap dan semua button-button untuk ke
   sekolah, akuarium, lautan itu berada di atasnya, teks langsung dan sebagainya."
   html.ak-hud  = telefon & tablet sentuh: kanvas 3D penuh skrin, semua kawalan terapung DI ATAS kanvas (selamat takuk).
   html.ak-putar = peranti masih menegak (kunci putaran / iPhone tanpa screen.orientation.lock): body diputar 90 darjah
                   (cara G17 lib/sg_game.css); enjin 3D menukar koordinat sentuhan (xy() dalam sg_akuarium3d.js).
   Laptop TIDAK berubah.
   ========================================================================== */
.ak-hud-sahaja, .ak-b-sisi, .ak-mula { display: none; }
html.ak-hud, html.ak-hud body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.ak-hud body { padding: 0 !important; margin: 0 !important; background: #06283D; }
html.ak-putar body { position: fixed; top: 0; left: 100vw; transform-origin: 0 0; transform: rotate(90deg); }
html.ak-hud .kd-kepala, html.ak-hud .sg-sisi, html.ak-hud .sg-nav-bawah, html.ak-hud .kd-langkau, html.ak-hud .ak-tt { display: none !important; }
html.ak-hud body > main.ak-utama { position: fixed; inset: 0; margin: 0 !important; padding: 0 !important; max-width: none !important; width: auto !important; gap: 0; display: block; }
html.ak-hud .ak-grid { display: block; }
html.ak-hud .ak-pentas { position: absolute; inset: 0; height: auto; min-height: 0; max-height: none; border-radius: 0; box-shadow: none; }
html.ak-hud .ak-hud-sahaja { display: inline-flex; }
/* bar atas kanan: Akuarium/Sungai/Lautan + butang ikon */
html.ak-hud .ak-kepala { position: absolute; z-index: 6; top: max(6px, env(safe-area-inset-top)); right: max(6px, env(safe-area-inset-right)); left: auto;
    padding: 0; margin: 0; border: 0; background: none; box-shadow: none; display: block; }
html.ak-hud .ak-alat { width: auto; flex-wrap: nowrap; gap: 4px; }
html.ak-hud .ak-per { flex: none; background: rgba(2, 44, 34, .66); border-color: rgba(255,255,255,.18); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
html.ak-hud .ak-per button { flex: none; min-height: 34px; padding: 0 10px; color: #D1FAE5; font-size: .78rem; }
html.ak-hud .ak-per button small { display: none; }
html.ak-hud .ak-per button.on { background: #FACC15; color: #064E3B; }
html.ak-hud .ak-alat .ak-b { flex: none; width: 40px; min-width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 12px; background: rgba(2, 44, 34, .66); color: #fff;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
html.ak-hud .ak-alat .ak-b[hidden] { display: none; }
html.ak-hud .ak-alat .ak-b .l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html.ak-hud .ak-alat .ak-b svg { width: 20px; height: 20px; }
html.ak-hud .ak-b-sisi { display: inline-flex; }
html.ak-hud.ak-sisi-buka .ak-b-sisi { background: #FACC15; color: #064E3B; }
/* tajuk + LANGSUNG kiri atas, zum kiri bawah */
html.ak-hud .ak-ov { position: absolute; inset: 0; display: block; pointer-events: none; }
html.ak-hud .ak-ov-tt { position: absolute; top: max(6px, env(safe-area-inset-top)); left: max(6px, env(safe-area-inset-left)); max-width: calc(100% - 430px); min-width: 150px; }
html.ak-hud .ak-ov-tt .ak-langsung { margin-bottom: 3px; padding: 1px 8px; font-size: .62rem; }
html.ak-hud .ak-ov-tt b { font-size: .86rem; }
html.ak-hud .ak-zum { position: absolute; left: max(6px, env(safe-area-inset-left)); bottom: max(6px, env(safe-area-inset-bottom)); flex-direction: row; }
/* panel kedudukan terapung (butang Kedudukan) */
html.ak-hud .ak-sisi { display: none; position: absolute; z-index: 7; top: calc(max(6px, env(safe-area-inset-top)) + 48px); right: max(6px, env(safe-area-inset-right));
    bottom: max(6px, env(safe-area-inset-bottom)); width: min(330px, 46%); max-height: none; box-shadow: var(--shadow-lg); }
html.ak-hud.ak-sisi-buka .ak-sisi { display: flex; }
html.ak-hud .ak-sen { max-height: none; }
/* pemilih sekolah / kod / kelas terapung di tengah */
html.ak-hud .ak-pilih { position: absolute; z-index: 8; top: calc(max(6px, env(safe-area-inset-top)) + 48px); left: 50%; transform: translateX(-50%);
    width: min(560px, calc(100% - 16px)); max-height: calc(100% - 62px); overflow: auto; box-sizing: border-box; box-shadow: var(--shadow-lg); }
html.ak-hud .ak-sen-sek { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
/* ketik untuk skrin penuh */
html.ak-hud .ak-mula:not([hidden]) { display: inline-flex; position: absolute; z-index: 5; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%);
    align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: #FACC15; color: #3B2600; font: inherit; font-size: .84rem; font-weight: 800;
    box-shadow: 0 6px 20px rgba(0,0,0,.35); cursor: pointer; white-space: nowrap; }
html.ak-hud .ak-mula svg { width: 18px; height: 18px; fill: currentColor; }
@media (max-width: 700px) { html.ak-hud:not(.ak-putar) .ak-ov-tt { max-width: calc(100% - 16px); } }
/* 27 Okt 2026 (pemilik: "di laptop tidak penuh sehingga ke bawah — tidak ikut standard"): laptop/tablet landskap — pentas & senarai
   kedudukan memenuhi tinggi skrin hingga 14px dari bawah (sama tepi kad). --ak-atas = kedudukan atas pentas (diukur akuarium.js). */
@media (min-width: 900px) {
    html:not(.ak-hud) .ak-pentas { height: calc(100dvh - var(--ak-atas, 190px) - 14px) !important; max-height: none !important; min-height: 420px; }
    html:not(.ak-hud) .ak-sisi { max-height: calc(100dvh - var(--ak-atas, 190px) - 14px) !important; height: calc(100dvh - var(--ak-atas, 190px) - 14px); box-sizing: border-box; }
}
