:root{
  --bg:#06172f;
  --bg2:#0a2a50;
  --panel:#0c315f;
  --cyan:#44dcff;
  --blue:#278bff;
  --violet:#7a55ff;
  --purple:#a146f2;
  --gold:#ffd45a;
  --orange:#ff9a3c;
  --green:#45d592;
  --ink:#eaf7ff;
  --muted:#9dbbd0;
  --line:rgba(118,206,255,.24);
  --glass:rgba(8,39,76,.72);
  --shadow:0 22px 60px rgba(0,12,35,.38);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;min-height:100vh;font-family:'Sarabun',Tahoma,sans-serif;color:var(--ink);background:
  radial-gradient(circle at 14% 0%,rgba(68,220,255,.14),transparent 28%),
  radial-gradient(circle at 82% 5%,rgba(122,85,255,.14),transparent 28%),
  linear-gradient(180deg,#041226 0,#082244 55%,#081a33 100%);overflow-x:hidden}
button,a,input,select,textarea{font:inherit}
a{color:inherit}
body::before{content:"";position:fixed;inset:0;pointer-events:none;opacity:.18;background-image:linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.035) 1px,transparent 1px);background-size:44px 44px;mask-image:linear-gradient(#000,transparent 78%)}

/* INTRO */
.intro{position:fixed;inset:0;z-index:10000;display:grid;place-content:center;text-align:center;background:radial-gradient(circle at 50% 28%,#154d88 0,#07182f 50%,#020815 100%);transition:opacity .65s ease,visibility .65s ease}
.intro.hidden{opacity:0;visibility:hidden}.intro__glow{position:absolute;left:50%;top:45%;width:420px;height:420px;transform:translate(-50%,-50%);border-radius:50%;background:radial-gradient(circle,rgba(68,220,255,.18),transparent 67%);filter:blur(4px)}
.intro__crest{position:relative;width:92px;height:92px;margin:0 auto 16px;border-radius:28px;display:grid;place-items:center;font-size:46px;color:var(--gold);background:linear-gradient(145deg,#0c376b,#10275b);border:3px solid #f9c84c;box-shadow:0 0 0 6px rgba(255,212,90,.08),0 0 45px rgba(68,220,255,.35);animation:intro-bob 1.6s ease-in-out infinite}
.intro__title{position:relative;font-size:clamp(34px,5vw,62px);font-weight:800;color:#fff7d1;text-shadow:0 3px 0 #9b5b00,0 0 25px rgba(68,220,255,.45)}
.intro__sub{position:relative;color:#bce8ff;font-weight:700;margin-top:6px}.intro__bar{position:relative;width:min(300px,70vw);height:9px;border-radius:99px;background:rgba(255,255,255,.09);margin:20px auto 0;overflow:hidden}.intro__bar i{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--cyan),#7185ff,var(--gold));animation:intro-load 1.55s ease forwards}
@keyframes intro-load{to{width:100%}}@keyframes intro-bob{50%{transform:translateY(-7px)}}

.app-shell{width:min(1640px,calc(100% - 24px));margin:0 auto;padding:12px 0 34px;position:relative;z-index:2}

/* TOP BAR */
.topbar{min-height:72px;display:grid;grid-template-columns:300px 1fr auto;align-items:center;gap:12px;margin-bottom:10px}
.player-card{display:flex;align-items:center;gap:12px;padding:7px 12px;border-radius:18px;background:linear-gradient(180deg,rgba(13,48,89,.95),rgba(6,29,58,.95));border:1px solid rgba(92,188,255,.28);box-shadow:inset 0 0 0 1px rgba(255,255,255,.025)}
.player-badge{width:50px;height:50px;border-radius:16px;display:grid;place-items:center;font-size:28px;color:#553d00;background:linear-gradient(145deg,#fff29b,#eaa82c);border:2px solid #ffe57a;box-shadow:0 5px 16px rgba(255,186,48,.22)}
.player-copy{min-width:0}.player-copy strong{display:block;font-size:14px}.player-level{display:flex;align-items:center;gap:7px;font-size:11px;color:#d8ebfb}.player-level>span{color:#ffd861;font-weight:800}.xp-mini{width:92px;height:8px;border-radius:99px;background:#172e52;overflow:hidden;border:1px solid rgba(255,255,255,.08)}.xp-mini i{display:block;height:100%;background:linear-gradient(90deg,#ffba32,#ffe66f,#49d4ff)}.player-level small{white-space:nowrap}
.game-nav{display:flex;align-items:center;justify-content:center;gap:8px;min-width:0}.game-nav__item{height:46px;padding:0 15px;border-radius:14px;text-decoration:none;display:inline-flex;align-items:center;gap:7px;color:#d9eaff;font-weight:700;font-size:14px;background:rgba(4,23,47,.74);border:1px solid rgba(103,181,255,.15);transition:.2s}.game-nav__item span{font-size:21px}.game-nav__item:hover,.game-nav__item.active{color:#fff1aa;border-color:#2e9eff;box-shadow:0 0 25px rgba(37,156,255,.15),inset 0 -2px 0 #299cff;background:linear-gradient(180deg,#123c70,#0b294f)}
.resource-bar{display:flex;align-items:center;gap:7px}.resource{height:44px;padding:0 13px;border-radius:14px;display:flex;align-items:center;gap:8px;background:linear-gradient(180deg,#0d305b,#071e3c);border:1px solid rgba(103,181,255,.18);font-weight:800;font-size:13px;white-space:nowrap}.resource b{font-size:21px;color:#ffd65b}.resource:nth-child(2) b{color:#48d8ff}.resource.energy{position:relative;padding-right:40px}.resource.energy b{color:#ffc540}.resource.energy small{position:absolute;right:9px;bottom:3px;color:#ffd65b;font-size:9px}.settings-btn{width:44px;height:44px;border-radius:14px;border:1px solid rgba(103,181,255,.18);background:#0b294d;color:#fff;font-size:20px;cursor:pointer}

/* HERO */
.hero-panel{position:relative;display:grid;grid-template-columns:230px minmax(420px,1fr) 440px 220px;min-height:520px;overflow:hidden;border-radius:30px;border:1px solid rgba(77,194,255,.28);background:
 radial-gradient(circle at 66% 34%,rgba(52,169,255,.17),transparent 22%),
 linear-gradient(135deg,rgba(7,31,63,.99),rgba(9,44,82,.98) 48%,rgba(35,38,101,.98));box-shadow:var(--shadow);isolation:isolate}
.hero-panel::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,rgba(3,13,29,.2),transparent 30%,transparent 70%,rgba(3,13,29,.18));z-index:-1}.grid-glow{position:absolute;inset:0;opacity:.17;background-image:linear-gradient(rgba(103,203,255,.15) 1px,transparent 1px),linear-gradient(90deg,rgba(103,203,255,.15) 1px,transparent 1px);background-size:38px 38px;mask-image:linear-gradient(#000,transparent 95%);z-index:-1}
.glass-card{background:linear-gradient(180deg,rgba(12,58,105,.78),rgba(4,29,61,.8));border:1px solid rgba(83,205,255,.3);box-shadow:inset 0 0 26px rgba(58,169,255,.06),0 12px 30px rgba(0,15,36,.25);backdrop-filter:blur(10px)}
.objective-card{align-self:start;margin:18px 0 18px 18px;padding:16px;border-radius:20px;z-index:2}.panel-title{font-weight:800;color:#d9f5ff}.panel-title.small{font-size:14px}.panel-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 0 5px rgba(69,213,146,.12);margin-right:7px}.objective-card ul{list-style:none;padding:0;margin:14px 0;display:grid;gap:11px}.objective-card li{display:flex;gap:8px;align-items:flex-start;font-size:12px;color:#e6f5ff}.objective-card li>i{width:21px;height:21px;border-radius:50%;display:grid;place-items:center;font-style:normal;color:#0b4f2c;background:#48df8e;font-weight:800;flex:0 0 auto}.objective-card li span{line-height:1.3}.objective-card li small{display:block;color:#52d7ff;margin-top:2px}.reset-time{border-top:1px solid rgba(255,255,255,.08);padding-top:9px;color:#90abc0;font-size:10px}.mission-start-mini{margin-top:16px;height:110px;border-radius:17px;display:grid;place-content:center;text-align:center;color:#60e4ff;border:1px solid rgba(70,220,255,.35);background:radial-gradient(circle,rgba(45,190,255,.15),transparent 70%);box-shadow:inset 0 0 25px rgba(35,190,255,.08)}.mission-start-mini span{font-size:13px;font-weight:800}.mission-start-mini b{font-size:24px;line-height:1}.mission-start-mini em{font-style:normal;font-size:22px;color:#d9f7ff;margin-top:6px}
.hero-copy{padding:32px 26px 24px;align-self:center;text-align:center;z-index:2}.game-crest{width:72px;height:62px;margin:0 auto -5px;clip-path:polygon(50% 0,92% 18%,84% 70%,50% 100%,16% 70%,8% 18%);display:grid;place-items:center;font-size:34px;color:#6d4c00;background:linear-gradient(145deg,#fff099,#e39e21);filter:drop-shadow(0 6px 6px rgba(0,0,0,.35));border:2px solid #fff}.game-kicker{font-size:31px;font-weight:800;color:#fff1ae;text-shadow:0 3px 0 #8a4d00}.hero-copy h1{margin:-3px 0 4px;font-size:clamp(48px,4.7vw,84px);line-height:.94;letter-spacing:-2px;color:#ffe488;text-shadow:0 4px 0 #9a4f00,0 0 2px #fff,0 0 26px rgba(53,191,255,.5);-webkit-text-stroke:1.2px #fff1b7}.subtitle-ribbon{display:inline-flex;align-items:center;gap:10px;padding:8px 25px;border-radius:15px;color:#ffe986;font-size:clamp(18px,1.7vw,28px);font-weight:800;background:linear-gradient(180deg,#123869,#071d3c);border:1px solid #eba734;box-shadow:0 4px 0 #05203f}.subtitle-ribbon span{color:#ffd24d}.teacher-credit{margin:11px 0 0;font-size:17px;font-weight:700;color:#f2f7ff}.hero-actions{display:flex;gap:14px;justify-content:center;margin-top:22px}.cta{min-width:230px;height:62px;border-radius:18px;border:0;display:flex;align-items:center;justify-content:center;gap:10px;font-size:21px;font-weight:800;cursor:pointer;transition:.18s;position:relative;overflow:hidden}.cta:hover{transform:translateY(-3px) scale(1.01)}.cta::before{content:"";position:absolute;top:-80%;left:-30%;width:40%;height:260%;transform:rotate(25deg);background:linear-gradient(90deg,transparent,rgba(255,255,255,.45),transparent);animation:button-shine 3.6s linear infinite}.cta--gold{color:#503700;background:linear-gradient(180deg,#ffe889,#ffbb24);box-shadow:0 7px 0 #bf7111,0 13px 25px rgba(255,166,37,.24);border:2px solid #fff1a7}.cta--blue{color:#fff;background:linear-gradient(180deg,#2f9cff,#1759c4);box-shadow:0 7px 0 #0a377d,0 13px 25px rgba(28,137,255,.22);border:2px solid #78d5ff}.cta-icon{font-size:25px}.chev{font-size:29px;margin-left:4px}.audio-status{height:18px;margin-top:12px;font-size:12px;font-weight:700;color:#71dcff}@keyframes button-shine{0%,55%{left:-40%}80%,100%{left:120%}}
.teacher-zone{position:relative;align-self:stretch;display:flex;align-items:flex-end;justify-content:center;z-index:3}.teacher-halo{position:absolute;width:420px;height:420px;border-radius:50%;top:28px;left:50%;transform:translateX(-50%);background:radial-gradient(circle,rgba(70,216,255,.2),transparent 67%);filter:blur(6px)}.teacher-img{position:relative;height:500px;max-width:100%;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 26px 24px rgba(0,0,0,.34));transform-origin:50% 90%;animation:teacher-float 4s ease-in-out infinite}.teacher-zone.speaking .teacher-img{animation:teacher-speak .62s ease-in-out infinite}.speech-bubble{position:absolute;right:-5px;top:42px;width:230px;border-radius:20px;padding:15px 16px 15px 50px;color:#fff;background:linear-gradient(180deg,#133d72,#0b274e);border:1px solid #f1b33c;box-shadow:0 12px 30px rgba(0,0,0,.25);z-index:4}.speech-bubble::after{content:"";position:absolute;left:-14px;bottom:22px;border-width:10px 15px 10px 0;border-style:solid;border-color:transparent #d59c30 transparent transparent;filter:drop-shadow(-2px 0 0 #0d2c56)}.speech-bubble .bulb{position:absolute;left:12px;top:14px;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;color:#523600;background:#ffd863;box-shadow:0 0 20px rgba(255,210,74,.35)}.speech-bubble small,.speech-bubble span{display:block;color:#d5eaff;font-size:11px}.speech-bubble strong{display:block;font-size:16px;margin:2px 0}.reward-mini{position:absolute;right:-3px;bottom:26px;width:235px;padding:12px 13px;border-radius:17px;z-index:5}.reward-mini__title{font-size:12px;color:#ffe17a;font-weight:800;margin-bottom:8px}.reward-items{display:grid;grid-template-columns:repeat(3,1fr);gap:5px}.reward-items>div{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:5px;padding:5px;border-radius:10px;background:rgba(255,255,255,.04)}.reward-items b{font-size:20px;color:#ffd557}.reward-items>div:nth-child(2) b{color:#4fdbff}.reward-items>div:nth-child(3) b{color:#f5a647}.reward-items span{font-size:9px;font-weight:700}.reward-items small{color:#fff;font-size:10px}.voice-wave{display:none;position:absolute;right:20px;top:245px;z-index:7;align-items:center;gap:3px;height:36px}.teacher-zone.speaking .voice-wave{display:flex}.voice-wave i{width:4px;height:12px;border-radius:9px;background:#6ce6ff;box-shadow:0 0 9px #50dfff;animation:wave .55s ease-in-out infinite alternate}.voice-wave i:nth-child(2){animation-delay:.1s}.voice-wave i:nth-child(3){animation-delay:.2s}.voice-wave i:nth-child(4){animation-delay:.3s}.voice-wave i:nth-child(5){animation-delay:.4s}.teacher-spark{position:absolute;width:8px;height:8px;border-radius:50%;background:#fff5a2;box-shadow:0 0 15px #fff1a2;animation:sparkle 2.4s ease-in-out infinite;z-index:5}.teacher-spark.s1{left:46px;top:105px}.teacher-spark.s2{right:48px;top:205px;animation-delay:.8s}.teacher-spark.s3{left:70px;bottom:86px;animation-delay:1.4s}@keyframes teacher-float{50%{transform:translateY(-7px)}}@keyframes teacher-speak{0%,100%{transform:translateY(0) scale(1)}50%{transform:translateY(-3px) scale(1.012)}}@keyframes wave{to{height:34px}}@keyframes sparkle{50%{opacity:.25;transform:scale(.45)}}
.rank-card{align-self:start;margin:18px 18px 18px 0;padding:14px;border-radius:20px;text-align:center;z-index:2}.rank-icon{font-size:38px;color:#5de2ff;margin:8px 0}.rank-card ol{padding-left:26px;margin:8px 0;text-align:left;font-size:11px;color:#bdd5e8}.rank-card li{padding:5px 0;border-bottom:1px solid rgba(255,255,255,.06)}.rank-card li span{display:inline-block;width:95px}.rank-card li b{color:#75d9ff}.rank-card button{margin-top:8px;border:1px solid #4ca8e6;color:#dff5ff;background:#0d3461;border-radius:10px;padding:7px 10px;font-size:10px;cursor:pointer}

/* PORTALS */
.portal-row{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:14px}.portal-card{position:relative;min-height:275px;overflow:hidden;display:grid;grid-template-columns:250px 1fr;border-radius:26px;border:1px solid rgba(92,190,255,.34);box-shadow:var(--shadow);background:linear-gradient(135deg,#07345e,#081d42)}.portal-card::before{content:"";position:absolute;inset:0;background-image:linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.035) 1px,transparent 1px);background-size:26px 26px;opacity:.5}.portal-card--parent{border-color:rgba(191,91,255,.48);background:linear-gradient(135deg,#251255,#361260)}.portal-visual{position:relative;z-index:2;overflow:hidden}.portal-visual::after{content:"";position:absolute;inset:55% 0 0;background:linear-gradient(transparent,rgba(5,22,45,.75))}.portal-visual img{width:100%;height:100%;object-fit:cover;object-position:center;transform:scale(1.04);transition:.35s}.portal-card:hover .portal-visual img{transform:scale(1.09)}.portal-content{position:relative;z-index:2;padding:28px 26px;align-self:center}.portal-tag{display:inline-flex;padding:6px 9px;border-radius:8px;background:rgba(76,190,255,.12);border:1px solid rgba(76,190,255,.2);color:#84dcff;font-size:10px;font-weight:800;letter-spacing:.7px}.portal-card--parent .portal-tag{background:rgba(212,92,255,.11);border-color:rgba(212,92,255,.24);color:#dfa4ff}.portal-content h2{font-size:37px;margin:6px 0 5px;color:#dff4ff;text-shadow:0 2px 0 #075aa2}.portal-card--parent h2{color:#f0d9ff;text-shadow:0 2px 0 #6c248f}.portal-content p{margin:0;color:#c3d9e9;font-size:14px;line-height:1.55;max-width:500px}.feature-chips{display:flex;gap:7px;flex-wrap:wrap;margin:13px 0}.feature-chips span{font-size:10px;font-weight:700;padding:6px 8px;border-radius:999px;color:#cfefff;background:rgba(69,183,255,.1);border:1px solid rgba(69,183,255,.15)}.portal-card--parent .feature-chips span{color:#f1d9ff;background:rgba(205,87,255,.1);border-color:rgba(205,87,255,.15)}.portal-btn{display:inline-flex;align-items:center;justify-content:center;gap:12px;min-width:210px;height:46px;border-radius:14px;text-decoration:none;font-weight:800;color:#fff;background:linear-gradient(180deg,#2e98ff,#1759bd);box-shadow:0 5px 0 #0b3474}.portal-card--parent .portal-btn{background:linear-gradient(180deg,#bb52f2,#7a2ab1);box-shadow:0 5px 0 #46166b}.portal-btn b{font-size:25px}

/* MISSION MAP */
.mission-section{margin-top:14px;padding:18px 18px 20px;border-radius:28px;border:1px solid rgba(81,193,255,.3);background:linear-gradient(180deg,#082f58,#071e3e);box-shadow:var(--shadow);overflow:hidden}.section-ribbon{width:max-content;max-width:90%;margin:0 auto;display:flex;align-items:center;justify-content:center;gap:12px;padding:7px 24px;border-radius:14px;border:1px solid #d99a31;background:linear-gradient(180deg,#113b6b,#071d3c);color:#ffe079;box-shadow:0 5px 0 #04162e}.section-ribbon h2{font-size:23px;margin:0}.section-ribbon span{color:#ffd95b}.section-subtitle{text-align:center;color:#a9c4d9;font-size:12px;margin:11px 0 13px}.mission-map{position:relative;aspect-ratio:1400/650;min-height:440px;max-height:650px;border-radius:24px;overflow:hidden;border:1px solid rgba(84,204,255,.18);box-shadow:inset 0 0 40px rgba(0,8,24,.25)}.map-art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.stage-layer{position:absolute;inset:0}.stage{position:absolute;width:112px;min-height:115px;transform:translate(-50%,-50%);display:grid;grid-template-columns:1fr;place-items:center;text-decoration:none;text-align:center;color:#fff;filter:drop-shadow(0 10px 12px rgba(0,0,0,.28));transition:.18s}.stage:hover{transform:translate(-50%,-54%) scale(1.05)}.stage-number{position:absolute;top:0;left:50%;transform:translateX(-50%);width:37px;height:37px;border-radius:50%;display:grid;place-items:center;font-weight:800;font-size:18px;z-index:3;background:linear-gradient(#59b94f,#25762c);border:3px solid #e7ffd0;box-shadow:0 4px 0 #154e1a}.stage-icon{margin-top:18px;width:68px;height:68px;border-radius:22px;display:grid;place-items:center;font-size:28px;font-weight:800;background:linear-gradient(180deg,#2b9e49,#126a32);border:4px solid #a9e96e;box-shadow:inset 0 -8px 0 rgba(0,0,0,.12),0 0 0 4px rgba(3,32,53,.7)}.stage b{margin-top:-5px;padding:4px 9px;border-radius:9px;background:rgba(2,23,40,.9);font-size:10px;white-space:nowrap;border:1px solid rgba(255,255,255,.13)}.stage em{font-style:normal;color:#ffd55b;font-size:13px;letter-spacing:1px}.s2 .stage-number,.s8 .stage-number{background:linear-gradient(#3b9de8,#1a5eb6);box-shadow:0 4px 0 #0f3f7f}.s2 .stage-icon,.s8 .stage-icon{background:linear-gradient(#308cd7,#164c9c);border-color:#7ad9ff}.s4 .stage-number,.s6 .stage-number{background:linear-gradient(#a560ef,#6f2ca7);box-shadow:0 4px 0 #471b73}.s4 .stage-icon,.s6 .stage-icon{background:linear-gradient(#9b4cdf,#602394);border-color:#d9a1ff}.s5 .stage-number,.s9 .stage-number{background:linear-gradient(#f6a33d,#bb5f16);box-shadow:0 4px 0 #823e08}.s5 .stage-icon,.s9 .stage-icon{background:linear-gradient(#e9972e,#ad5710);border-color:#ffcc73}.s7 .stage-number{background:linear-gradient(#33bfc5,#16868c);box-shadow:0 4px 0 #0b5c61}.s7 .stage-icon{background:linear-gradient(#24aeb6,#116d75);border-color:#80eced}.s10 .stage-number{background:linear-gradient(#ffd261,#d48c1b);box-shadow:0 4px 0 #965b0d}.s10 .stage-icon{background:linear-gradient(#f5be48,#bd7812);border-color:#fff0a0}.stage.current .stage-icon{animation:current-pulse 1.7s ease-in-out infinite}.stage.locked{opacity:.82}.stage.locked::after{content:"🔒";position:absolute;right:7px;top:28px;font-size:14px;filter:none}.stage.completed::before{content:"ผ่านแล้ว";position:absolute;left:-18px;top:43px;padding:3px 6px;border-radius:7px;background:#176e3c;color:#b9ffd6;font-size:8px;font-weight:800}.stage.current::before{content:"กำลังเล่น";position:absolute;left:-20px;top:43px;padding:3px 6px;border-radius:7px;background:#95540c;color:#ffe0a2;font-size:8px;font-weight:800}.s1{left:12%;top:34%}.s2{left:29%;top:25%}.s3{left:46%;top:32%}.s4{left:65%;top:25%}.s5{left:86%;top:34%}.s6{left:17%;top:72%}.s7{left:36%;top:65%}.s8{left:55%;top:70%}.s9{left:74%;top:63%}.s10{left:91%;top:70%}@keyframes current-pulse{50%{box-shadow:inset 0 -8px 0 rgba(0,0,0,.12),0 0 0 4px rgba(3,32,53,.7),0 0 35px rgba(255,186,53,.7)}}

/* BOTTOM WIDGETS */
.bottom-grid{display:grid;grid-template-columns:1.35fr 1.1fr .8fr 1fr;gap:12px;margin-top:14px}.hud-card{min-height:125px;border-radius:20px;border:1px solid rgba(92,190,255,.24);background:linear-gradient(180deg,#0b305a,#071e3d);box-shadow:0 14px 35px rgba(0,13,31,.25);padding:15px}.daily-head{display:flex;align-items:center;gap:11px}.target{width:43px;height:43px;border-radius:14px;display:grid;place-items:center;font-size:27px;color:#ffcf56;background:#123b68}.daily-head b{display:block;color:#ffd55b}.daily-head small{display:block;color:#a6c3d9;font-size:10px;margin-top:2px}.daily-list{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-top:12px}.daily-list>div{display:grid;grid-template-columns:auto 1fr;gap:5px;align-items:center;padding:7px;border-radius:11px;background:rgba(255,255,255,.035);font-size:9px}.daily-list span{font-size:19px;color:#64e899}.daily-list b{font-size:9px}.daily-list em{grid-column:2;font-style:normal;color:#ffd45c;font-size:9px}.progress-card{display:grid;grid-template-columns:90px 1fr;align-items:center}.progress-crest{width:76px;height:76px;margin:auto;display:grid;place-items:center;font-size:42px;color:#6a4800;background:linear-gradient(#ffe984,#e69d25);clip-path:polygon(50% 0,91% 18%,84% 70%,50% 100%,16% 70%,9% 18%)}.progress-content>span{color:#cfe3f3;font-size:11px}.progress-content>b{display:block;font-size:15px}.progress-line{height:11px;margin:9px 0 5px;border-radius:99px;background:#172d50;position:relative;overflow:visible}.progress-line i{display:block;width:50%;height:100%;border-radius:inherit;background:linear-gradient(90deg,#92e61f,#59bd12)}.progress-line em{position:absolute;right:0;top:-4px;font-style:normal;font-size:11px}.progress-content small{font-size:9px;color:#9fb8cc}.progress-content strong{color:#ffd658}.treasure-card{display:flex;align-items:center;gap:12px}.treasure{font-size:58px;color:#f7bd3c;filter:drop-shadow(0 0 15px rgba(255,187,45,.35))}.treasure-card span{display:block;color:#ffd765;font-size:10px}.treasure-card b{display:block;font-size:20px}.treasure-card small{color:#54dcff}.coach-card{display:grid;grid-template-columns:82px 1fr;align-items:center;overflow:hidden;background:linear-gradient(135deg,#0b5290,#0d2c65)}.coach-card img{height:115px;width:92px;object-fit:contain;object-position:center bottom;align-self:end;filter:drop-shadow(0 8px 8px rgba(0,0,0,.3))}.coach-card b{display:block;font-size:19px}.coach-card span{display:block;color:#d0ecff;font-size:12px;margin-top:4px}
.game-footer{display:flex;justify-content:center;gap:18px;align-items:center;padding:18px 0 3px;color:#7896ae;font-size:11px}.game-footer a{text-decoration:none;color:#adc9dd;font-weight:700}

/* MODAL */
.story-modal{position:fixed;inset:0;z-index:9000;display:none;align-items:center;justify-content:center;padding:20px;background:rgba(1,8,20,.84);backdrop-filter:blur(14px)}.story-modal.open{display:flex}.story-box{position:relative;width:min(680px,96vw);padding:32px;border-radius:28px;border:1px solid rgba(80,203,255,.32);background:linear-gradient(180deg,#0c3765,#071d3b);box-shadow:0 30px 90px rgba(0,0,0,.5);text-align:center;animation:modal-in .28s ease}.story-close{position:absolute;right:14px;top:12px;border:0;background:transparent;color:#b9d6e9;font-size:27px;cursor:pointer}.story-shield{width:72px;height:72px;margin:auto;display:grid;place-items:center;clip-path:polygon(50% 0,91% 18%,84% 70%,50% 100%,16% 70%,9% 18%);font-size:37px;color:#6a4800;background:linear-gradient(#ffe984,#e69d25)}.story-label{margin-top:8px;color:#75ddff;font-size:11px;font-weight:800;letter-spacing:1px}.story-box h2{margin:4px 0 8px;font-size:35px;color:#fff0aa}.story-box p{color:#bfd6e7;line-height:1.7;margin:0 auto;max-width:580px}.story-reward{margin:18px auto 0;display:flex;gap:8px;justify-content:center;align-items:center;flex-wrap:wrap}.story-reward span{color:#a9c7dc;font-size:11px}.story-reward b{padding:8px 10px;border-radius:10px;background:rgba(255,255,255,.05);color:#ffda67}.story-actions{display:flex;justify-content:center;gap:10px;margin-top:20px}.story-actions button{min-width:150px;height:46px;border-radius:13px;font-weight:800;cursor:pointer}.story-secondary{color:#d6e8f5;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.06)}.story-primary{color:#533800;border:1px solid #fff0a4;background:linear-gradient(#ffe98f,#ffc947)}@keyframes modal-in{from{transform:translateY(14px) scale(.97);opacity:0}}
.spark{position:fixed;width:7px;height:7px;border-radius:50%;pointer-events:none;z-index:10001;animation:spark-pop .75s ease-out forwards}@keyframes spark-pop{to{transform:translate(var(--sx),var(--sy)) scale(0);opacity:0}}
.mobile-nav{display:none}

/* TABLET */
@media (max-width:1180px){
  .app-shell{width:min(100% - 18px,1640px)}
  .topbar{grid-template-columns:250px 1fr auto}.game-nav__item{padding:0 10px;font-size:12px}.desktop-only{display:none}.resource{padding:0 9px}.resource:nth-child(2){display:none}
  .hero-panel{grid-template-columns:210px minmax(360px,1fr) 380px}.rank-card{display:none}.teacher-img{height:465px}.speech-bubble{right:0;width:210px}.reward-mini{right:0;width:218px}
  .portal-card{grid-template-columns:210px 1fr}.portal-content h2{font-size:32px}
  .bottom-grid{grid-template-columns:1fr 1fr}.coach-card{min-height:130px}
}
@media (max-width:900px){
  body{padding-bottom:72px}.topbar{grid-template-columns:1fr auto}.game-nav{display:none}.resource:nth-child(3){display:none}
  .hero-panel{grid-template-columns:1fr 390px;grid-template-areas:"copy teacher" "objective teacher";min-height:auto}.hero-copy{grid-area:copy;padding:28px 16px 8px}.teacher-zone{grid-area:teacher;min-height:520px}.objective-card{grid-area:objective;margin:8px 10px 16px;display:grid;grid-template-columns:1fr 1fr;gap:6px 14px}.objective-card .panel-title,.objective-card .reset-time{grid-column:1/-1}.objective-card ul{margin:6px 0}.mission-start-mini{margin:4px 0;min-height:96px}.teacher-img{height:490px}.speech-bubble{top:28px;right:10px}.reward-mini{bottom:18px;right:7px}
  .portal-card{grid-template-columns:180px 1fr;min-height:250px}.portal-content{padding:20px 18px}.portal-content p{font-size:12px}.portal-btn{min-width:180px}.mission-map{min-height:420px}
  .stage{width:96px}.stage-icon{width:60px;height:60px}.stage b{font-size:9px}.stage-number{width:33px;height:33px;font-size:15px}
  .mobile-nav{position:fixed;z-index:7000;display:grid;grid-template-columns:repeat(4,1fr);left:8px;right:8px;bottom:8px;height:62px;border-radius:18px;background:rgba(4,21,44,.96);border:1px solid rgba(98,194,255,.25);box-shadow:0 15px 35px rgba(0,0,0,.35);backdrop-filter:blur(14px);overflow:hidden}.mobile-nav a{text-decoration:none;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#9db6ca;font-size:10px;font-weight:700}.mobile-nav a span{font-size:21px;line-height:1}.mobile-nav a.active{color:#ffe170;background:linear-gradient(180deg,rgba(49,145,255,.18),rgba(49,145,255,.04))}
}
/* MOBILE */
@media (max-width:680px){
  .app-shell{width:min(100% - 10px,1640px);padding-top:5px}.topbar{min-height:58px;gap:7px}.player-card{padding:5px 8px}.player-badge{width:40px;height:40px;border-radius:13px;font-size:22px}.player-copy strong{font-size:11px}.player-level small{display:none}.xp-mini{width:65px}.resource-bar{gap:5px}.resource{height:39px;font-size:11px;padding:0 9px}.resource:nth-child(1){padding:0 8px}.settings-btn{width:39px;height:39px;border-radius:12px}
  .hero-panel{display:flex;flex-direction:column;border-radius:23px}.hero-copy{order:1;padding:24px 12px 0}.game-crest{width:58px;height:52px;font-size:27px}.game-kicker{font-size:24px}.hero-copy h1{font-size:clamp(43px,14vw,62px)}.subtitle-ribbon{font-size:18px;padding:7px 16px}.teacher-credit{font-size:13px}.hero-actions{flex-direction:column;gap:9px;margin-top:17px}.cta{width:100%;min-width:0;height:56px;font-size:19px}.teacher-zone{order:2;min-height:465px;width:100%}.teacher-img{height:450px;max-width:95%}.teacher-halo{width:330px;height:330px}.speech-bubble{right:8px;top:18px;width:190px;padding:11px 12px 11px 43px}.speech-bubble strong{font-size:13px}.speech-bubble small,.speech-bubble span{font-size:9px}.speech-bubble .bulb{width:26px;height:26px;left:9px;top:10px}.reward-mini{bottom:10px;right:8px;width:205px}.objective-card{order:3;margin:0 8px 10px;display:block}.objective-card .mission-start-mini{display:none}.objective-card ul{grid-template-columns:1fr 1fr}.rank-card{display:none}
  .portal-row{grid-template-columns:1fr;gap:10px}.portal-card{grid-template-columns:135px 1fr;min-height:225px;border-radius:22px}.portal-content{padding:16px 12px}.portal-tag{font-size:8px}.portal-content h2{font-size:27px}.portal-content p{font-size:11px}.feature-chips{margin:9px 0}.feature-chips span{font-size:8px}.portal-btn{min-width:150px;height:40px;font-size:12px}.portal-visual img{object-position:48% center}
  .mission-section{padding:14px 8px 14px;border-radius:23px}.section-ribbon{padding:7px 13px}.section-ribbon h2{font-size:18px}.section-subtitle{padding:0 12px;font-size:10px}.mission-map{aspect-ratio:auto;min-height:1020px;max-height:none;background:linear-gradient(#0d5b8d,#072d55)}.map-art{height:100%;object-fit:cover;opacity:.72}.stage-layer{padding:24px 12px;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:repeat(5,1fr);gap:10px}.stage{position:relative!important;left:auto!important;top:auto!important;transform:none!important;width:100%;min-height:170px;border-radius:18px;padding:8px;background:rgba(5,32,61,.68);border:1px solid rgba(103,215,255,.17);backdrop-filter:blur(5px)}.stage:hover{transform:translateY(-2px)!important}.stage-number{top:8px}.stage-icon{margin-top:35px}.stage b{font-size:10px}.stage.completed::before,.stage.current::before{left:8px;top:8px}.stage.locked::after{right:9px;top:8px}.stage em{margin-bottom:4px}
  .bottom-grid{grid-template-columns:1fr;gap:9px}.hud-card{min-height:115px}.daily-list{grid-template-columns:1fr 1fr 1fr}.progress-card{grid-template-columns:80px 1fr}.treasure-card{justify-content:center}.coach-card{grid-template-columns:90px 1fr}.coach-card img{height:105px}
  .game-footer{flex-direction:column;gap:5px;padding:15px 0 3px}
  .story-box{padding:27px 18px}.story-box h2{font-size:29px}.story-actions{flex-direction:column}.story-actions button{width:100%}
}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* =========================================================
   FINAL HERO LAYOUT V7
   Right HUD order on Desktop:
   1) รางวัลแนะนำ
   2) TOP RANK
   ========================================================= */

/* ---------- clue box stays with center content ---------- */
.hero-copy .speech-bubble--copy{
    position:relative !important;
    left:auto !important;
    right:auto !important;
    top:auto !important;
    bottom:auto !important;
    width:min(430px,100%) !important;
    margin:15px auto 0 !important;
    padding:13px 48px 13px 50px !important;
    text-align:left;
    color:#fff;
    border-radius:17px;
    background:linear-gradient(180deg,#143e73,#0a284f);
    border:1px solid #efb33d;
    box-shadow:
        0 12px 28px rgba(0,0,0,.22),
        inset 0 0 20px rgba(74,179,255,.05);
    z-index:6;
}

.hero-copy .speech-bubble--copy::after{
    content:"";
    position:absolute;
    right:-13px !important;
    left:auto !important;
    bottom:18px !important;
    top:auto !important;
    border-width:10px 0 10px 14px !important;
    border-style:solid;
    border-color:transparent transparent transparent #efb33d !important;
    filter:none !important;
}

.hero-copy .speech-bubble--copy .bulb{
    position:absolute;
    left:12px;
    top:50%;
    transform:translateY(-50%);
    width:29px;
    height:29px;
    border-radius:50%;
    display:grid;
    place-items:center;
    color:#553700;
    background:#ffd765;
    box-shadow:0 0 18px rgba(255,210,74,.30);
}

.hero-copy .speech-bubble--copy small,
.hero-copy .speech-bubble--copy span{
    display:block;
    color:#d5eaff;
    font-size:11px;
}

.hero-copy .speech-bubble--copy strong{
    display:block;
    margin:2px 0;
    color:#fff;
    font-size:16px;
    line-height:1.25;
}

/* Never allow another speech bubble to float over teacher */
.teacher-zone > .speech-bubble{
    display:none !important;
}


/* ---------- teacher visual area ---------- */
.teacher-zone{
    position:relative;
    overflow:visible !important;
    padding-left:8px;
    padding-right:8px;
}


/* =========================================================
   DESKTOP — reward above TOP RANK
   Hero columns:
   objective | title | teacher | right HUD
   ========================================================= */
@media (min-width:1181px){

    /* Put reward HUD into the right-hand HUD column */
    .teacher-zone .reward-mini{
        position:absolute !important;

        /* Start immediately to the right of teacher column */
        left:calc(100% + 12px) !important;
        right:auto !important;

        top:28px !important;
        bottom:auto !important;

        width:205px !important;
        margin:0 !important;
        transform:none !important;

        z-index:9 !important;
    }

    /* TOP RANK sits directly below reward HUD */
    .rank-card{
        position:relative !important;
        align-self:start !important;

        top:auto !important;
        right:auto !important;
        bottom:auto !important;
        left:auto !important;

        /* reward ~90px high + comfortable gap */
        margin:138px 14px 18px 0 !important;

        z-index:5 !important;
    }
}


/* =========================================================
   LAPTOP / SMALL DESKTOP
   Existing layout hides TOP RANK, so reward returns near teacher
   ========================================================= */
@media (min-width:901px) and (max-width:1180px){

    .teacher-zone .reward-mini{
        position:absolute !important;
        left:8px !important;
        right:auto !important;
        top:auto !important;
        bottom:20px !important;
        width:212px !important;
        margin:0 !important;
        transform:none !important;
        z-index:8 !important;
    }

    .hero-copy .speech-bubble--copy{
        width:min(400px,96%) !important;
        margin-top:12px !important;
    }
}


/* =========================================================
   TABLET
   Reward remains attached to teacher area
   ========================================================= */
@media (min-width:681px) and (max-width:900px){

    .teacher-zone{
        padding-bottom:110px !important;
    }

    .teacher-zone .reward-mini{
        position:absolute !important;
        left:4px !important;
        right:auto !important;
        top:auto !important;
        bottom:16px !important;
        width:205px !important;
        margin:0 !important;
        transform:none !important;
        z-index:8 !important;
    }

    .hero-copy .speech-bubble--copy{
        width:min(380px,96%) !important;
        margin-top:11px !important;
    }

    .rank-card{
        display:none !important;
    }
}


/* =========================================================
   MOBILE
   All floating cards become normal flow
   ========================================================= */
@media (max-width:680px){

    .hero-copy .speech-bubble--copy{
        position:relative !important;
        width:100% !important;
        margin:13px 0 0 !important;
        padding:12px 13px 12px 44px !important;
    }

    .hero-copy .speech-bubble--copy::after{
        display:none !important;
    }

    .hero-copy .speech-bubble--copy strong{
        font-size:14px;
    }

    .hero-copy .speech-bubble--copy small,
    .hero-copy .speech-bubble--copy span{
        font-size:10px;
    }

    .teacher-zone{
        padding-bottom:14px !important;
    }

    .teacher-zone .reward-mini{
        position:relative !important;
        left:auto !important;
        right:auto !important;
        top:auto !important;
        bottom:auto !important;
        width:min(92%,320px) !important;
        margin:-8px auto 4px !important;
        transform:none !important;
        z-index:8 !important;
    }

    .rank-card{
        display:none !important;
    }
}

/* =========================================================
   PORTAL LAYOUT V10 — CALCULATED, NOT EYEBALLED
   ---------------------------------------------------------
   Desktop target from actual screenshot:
   card width ≈ 736px
   ideal portal ratio = 2.25 : 1
   calculated height ≈ 736 / 2.25 = 327px

   Artwork column = 28%
   Content column = 72%

   Why 28%?
   At 736px card width:
   736 × .28 ≈ 206px artwork area.

   With a 327px-tall art area and source portraits:
   student source = 195 × 295
   parent source  = 185 × 295

   Scale 1.30 + directional transform-origin crops:
   student -> visible source area approx x=0..143, y=0..227
   parent  -> visible source area approx x=43..185, y=0..227

   This intentionally removes the old text/button fragments
   embedded inside the source portrait images.
   ========================================================= */

/* ---------- DESKTOP ---------- */
@media (min-width:1181px){

    .portal-row{
        display:grid !important;
        grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
        gap:18px !important;
        align-items:stretch !important;
        margin-top:18px !important;
    }

    .portal-card{
        position:relative !important;
        display:grid !important;
        grid-template-columns:28% 72% !important;

        /* exact ratio prevents the overly tall cards */
        aspect-ratio:2.25 / 1 !important;
        min-height:0 !important;
        height:auto !important;

        overflow:hidden !important;
        border-radius:27px !important;
    }

    .portal-visual{
        position:relative !important;
        min-width:0 !important;
        min-height:0 !important;
        height:100% !important;
        overflow:hidden !important;
        isolation:isolate;
    }

    /* Blend the artwork edge into the content */
    .portal-visual::before{
        content:"";
        position:absolute;
        inset:0;
        z-index:3;
        pointer-events:none;
        background:
            linear-gradient(
                90deg,
                transparent 0%,
                transparent 66%,
                rgba(7,45,82,.20) 80%,
                rgba(7,45,82,.96) 100%
            );
    }

    .portal-card--parent .portal-visual::before{
        background:
            linear-gradient(
                90deg,
                transparent 0%,
                transparent 66%,
                rgba(53,18,91,.20) 80%,
                rgba(53,18,91,.96) 100%
            );
    }

    .portal-visual::after{
        display:none !important;
    }

    .portal-visual img{
        position:absolute !important;
        inset:0 !important;
        width:100% !important;
        height:100% !important;
        max-width:none !important;

        object-fit:cover !important;

        /* mathematically chosen crop */
        transform:scale(1.30) !important;
        transition:transform .28s ease !important;
    }

    /* Student source has unwanted UI on the RIGHT.
       Lock the useful character region to LEFT/TOP. */
    .portal-card--student .portal-visual img{
        object-position:left top !important;
        transform-origin:left top !important;
    }

    /* Parent source has unwanted UI/text on the LEFT.
       Lock useful character region to RIGHT/TOP. */
    .portal-card--parent .portal-visual img{
        object-position:right top !important;
        transform-origin:right top !important;
    }

    .portal-card:hover .portal-visual img{
        transform:scale(1.33) !important;
    }

    .portal-content{
        position:relative !important;
        z-index:4 !important;

        display:flex !important;
        flex-direction:column !important;
        align-items:flex-start !important;
        justify-content:center !important;

        min-width:0 !important;
        height:100% !important;
        padding:26px 30px 24px !important;
    }

    .portal-tag{
        flex:0 0 auto !important;
    }

    .portal-content h2{
        margin:7px 0 6px !important;
        font-size:clamp(31px,2.15vw,38px) !important;
        line-height:1.05 !important;
    }

    .portal-content p{
        margin:0 !important;
        max-width:540px !important;
        min-height:0 !important;
        font-size:13px !important;
        line-height:1.55 !important;
    }

    .feature-chips{
        display:flex !important;
        flex-wrap:wrap !important;
        gap:7px !important;
        margin:13px 0 16px !important;
    }

    .portal-btn{
        min-width:210px !important;
        height:46px !important;
        margin-top:0 !important;
        flex:0 0 auto !important;
    }
}


/* ---------- LAPTOP / SMALL DESKTOP ---------- */
@media (min-width:901px) and (max-width:1180px){

    .portal-row{
        display:grid !important;
        grid-template-columns:1fr 1fr !important;
        gap:14px !important;
    }

    .portal-card{
        display:grid !important;
        grid-template-columns:30% 70% !important;
        aspect-ratio:1.90 / 1 !important;
        min-height:0 !important;
        height:auto !important;
    }

    .portal-visual{
        height:100% !important;
        min-height:0 !important;
        overflow:hidden !important;
    }

    .portal-visual img{
        position:absolute !important;
        inset:0 !important;
        width:100% !important;
        height:100% !important;
        max-width:none !important;
        object-fit:cover !important;
        transform:scale(1.24) !important;
    }

    .portal-card--student .portal-visual img{
        object-position:left top !important;
        transform-origin:left top !important;
    }

    .portal-card--parent .portal-visual img{
        object-position:right top !important;
        transform-origin:right top !important;
    }

    .portal-card:hover .portal-visual img{
        transform:scale(1.27) !important;
    }

    .portal-content{
        display:flex !important;
        flex-direction:column !important;
        justify-content:center !important;
        align-items:flex-start !important;
        padding:21px 20px !important;
    }

    .portal-content h2{
        margin:5px 0 !important;
        font-size:29px !important;
    }

    .portal-content p{
        min-height:0 !important;
        font-size:11px !important;
        line-height:1.5 !important;
    }

    .feature-chips{
        margin:10px 0 12px !important;
    }

    .feature-chips span{
        font-size:8px !important;
        padding:5px 7px !important;
    }

    .portal-btn{
        min-width:170px !important;
        height:41px !important;
        font-size:12px !important;
    }
}


/* ---------- TABLET ---------- */
@media (min-width:681px) and (max-width:900px){

    .portal-row{
        display:grid !important;
        grid-template-columns:1fr !important;
        gap:14px !important;
    }

    .portal-card{
        display:grid !important;
        grid-template-columns:30% 70% !important;
        aspect-ratio:2.35 / 1 !important;
        min-height:270px !important;
        height:auto !important;
    }

    .portal-visual{
        min-height:0 !important;
        height:100% !important;
        overflow:hidden !important;
    }

    .portal-visual img{
        position:absolute !important;
        inset:0 !important;
        width:100% !important;
        height:100% !important;
        object-fit:cover !important;
        transform:scale(1.25) !important;
    }

    .portal-card--student .portal-visual img{
        object-position:left top !important;
        transform-origin:left top !important;
    }

    .portal-card--parent .portal-visual img{
        object-position:right top !important;
        transform-origin:right top !important;
    }

    .portal-content{
        padding:22px 24px !important;
    }

    .portal-content h2{
        font-size:31px !important;
    }
}


/* ---------- MOBILE ---------- */
@media (max-width:680px){

    .portal-row{
        display:grid !important;
        grid-template-columns:1fr !important;
        gap:12px !important;
        margin-top:12px !important;
    }

    .portal-card{
        display:grid !important;
        grid-template-columns:1fr !important;
        grid-template-rows:220px auto !important;

        aspect-ratio:auto !important;
        min-height:0 !important;
        height:auto !important;

        border-radius:22px !important;
    }

    .portal-visual{
        position:relative !important;
        width:100% !important;
        height:220px !important;
        min-height:220px !important;
        overflow:hidden !important;
    }

    .portal-visual::before{
        background:
            linear-gradient(
                180deg,
                transparent 0%,
                transparent 54%,
                rgba(7,45,82,.20) 70%,
                rgba(7,45,82,.97) 100%
            ) !important;
    }

    .portal-card--parent .portal-visual::before{
        background:
            linear-gradient(
                180deg,
                transparent 0%,
                transparent 54%,
                rgba(53,18,91,.20) 70%,
                rgba(53,18,91,.97) 100%
            ) !important;
    }

    .portal-visual img{
        position:absolute !important;
        inset:0 !important;
        width:100% !important;
        height:100% !important;
        object-fit:cover !important;
        transform:scale(1.12) !important;
    }

    .portal-card--student .portal-visual img{
        object-position:left 10% !important;
        transform-origin:left top !important;
    }

    .portal-card--parent .portal-visual img{
        object-position:right 10% !important;
        transform-origin:right top !important;
    }

    .portal-card:hover .portal-visual img{
        transform:scale(1.14) !important;
    }

    .portal-content{
        display:flex !important;
        flex-direction:column !important;
        align-items:stretch !important;
        justify-content:flex-start !important;
        padding:17px 16px 19px !important;
    }

    .portal-tag{
        align-self:flex-start !important;
    }

    .portal-content h2{
        margin:6px 0 !important;
        font-size:28px !important;
    }

    .portal-content p{
        min-height:0 !important;
        font-size:11px !important;
    }

    .feature-chips{
        margin:11px 0 13px !important;
    }

    .portal-btn{
        width:100% !important;
        min-width:0 !important;
        height:44px !important;
    }
}

/* =========================================================
   ADMIN LOGIN BUTTON V11
   Gear icon at top-right opens admin login
   ========================================================= */

.settings-btn{
    display:grid !important;
    place-items:center !important;
    flex:0 0 auto !important;
    text-decoration:none !important;
    line-height:1 !important;
    transition:
        transform .18s ease,
        border-color .18s ease,
        background .18s ease,
        box-shadow .18s ease !important;
}

.settings-btn:hover{
    transform:translateY(-2px) rotate(10deg);
    border-color:#55c9ff !important;
    background:#103b6a !important;
    box-shadow:
        0 0 0 2px rgba(75,184,255,.08),
        0 8px 20px rgba(0,0,0,.22),
        0 0 18px rgba(54,184,255,.15);
}

.settings-btn:focus-visible{
    outline:2px solid #ffd65b;
    outline-offset:3px;
}

.admin-login-btn{
    position:relative;
}

/* Desktop hover label */
@media (hover:hover) and (min-width:901px){
    .admin-login-btn::after{
        content:"เข้าสู่ระบบผู้ดูแล";
        position:absolute;
        right:0;
        top:calc(100% + 10px);

        width:max-content;
        max-width:180px;
        padding:8px 11px;
        border-radius:10px;

        color:#fff;
        background:#061a34;
        border:1px solid rgba(90,194,255,.32);
        box-shadow:0 9px 24px rgba(0,0,0,.28);

        font-family:'Sarabun',Tahoma,sans-serif;
        font-size:11px;
        font-weight:700;
        white-space:nowrap;

        opacity:0;
        visibility:hidden;
        transform:translateY(-5px);
        pointer-events:none;
        transition:.16s ease;
        z-index:100;
    }

    .admin-login-btn:hover::after,
    .admin-login-btn:focus-visible::after{
        opacity:1;
        visibility:visible;
        transform:translateY(0);
    }
}

