/* 學習島 — levels: home layout, level bar, island level chip, level-up card */
#hub .hub-base{display:flex;flex-direction:column;gap:16px}
#hub .hub-heading{display:none}
#hub #missionBar{order:1;margin-top:0}
#hub .level-bar{order:2}
#hub .worlds{order:3}

.level-bar{background:#fff;border:1px solid #dce6df;border-radius:26px;padding:12px 16px 10px}
.lv-row{display:flex;justify-content:space-between;align-items:flex-end;position:relative;gap:6px}
.lv-row::before{content:"";position:absolute;left:8%;right:8%;top:52%;border-top:4px dotted #cfdcd5;pointer-events:none}
.lv-btn{position:relative;flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:3px;min-height:132px;
  padding:14px 6px 8px;border-radius:22px;border:2px solid transparent;background:#fff;color:#233f43;transition:transform .15s}
.lv-btn:hover{transform:translateY(-3px)}
.lv-btn.viewing{background:#e3f1ee;border-color:#478f7f}
.lv-btn.mine:not(.viewing){background:#fff7de;border-color:#e6c460}
.lv-art{display:flex;align-items:flex-end;justify-content:center;height:78px}
.lv-art svg{height:100%;width:auto;max-width:100%}
.lv-size1 svg{height:54px}.lv-size2 svg{height:62px}.lv-size3 svg{height:72px}.lv-size4 svg{height:82px}.lv-size5 svg{height:92px}
.lv-name{font-size:13px;font-weight:800;text-align:center;line-height:1.2}
.lv-bar{width:78%;height:7px;border-radius:4px;background:#e3e9e2;overflow:hidden}
.lv-bar i{display:block;height:100%;background:#f9cb62}
.lv-count{font-size:12px;color:#6d817d;font-weight:700}
.lv-note{position:absolute;top:-4px;left:50%;transform:translateX(-50%);background:#478f7f;color:#fff;font-size:11px;font-weight:800;padding:2px 10px;border-radius:10px;white-space:nowrap}
.lv-gold{position:absolute;top:8px;right:10px;color:#e0a31c;font-size:20px;line-height:1}
.lv-btn.complete .lv-art svg{filter:drop-shadow(0 0 5px #f2c14e)}
.lv-banner{display:flex;align-items:center;gap:12px;background:#eef1fb;border:2px dashed #5a6fb8;border-radius:16px;padding:6px 14px;margin-bottom:10px}
.lv-banner span{flex:1;font-size:14px;font-weight:700}
.lv-back{min-height:40px;padding:0 16px;border-radius:20px;background:#233f43;color:#fff;font-weight:800;font-size:14px}

.world-progress{display:flex;flex-direction:column;align-items:flex-end;gap:5px;margin-left:auto;margin-right:8px;min-width:100px}
.wp-bar{display:block;width:110px;height:11px;border-radius:6px;background:#e8eee6;overflow:hidden}
.wp-bar i{display:block;height:100%;background:#f9cb62}
.world-progress em{font-style:normal;font-size:13px;font-weight:800;color:#366960}

.level-chip{display:flex;align-items:center;gap:10px;margin:10px 0 4px}
.lc-art{display:inline-flex;height:40px}.lc-art svg{height:100%;width:auto}
.level-chip b{font-size:16px}
.lc-pick{display:flex;gap:6px;margin-left:auto}
.lc-dot{width:48px;height:44px;border-radius:14px;background:#fff;border:2px solid #dce6df;display:grid;place-items:center;padding:0}
.lc-dot.on{background:#e3f1ee;border-color:#478f7f}
.lc-dot span{display:flex;height:26px}.lc-dot svg{height:100%;width:auto}

.stage-all{grid-column:1/-1;justify-self:center;min-height:44px;padding:0 22px;border-radius:22px;background:#edf1e6;color:#366960;font-weight:800;font-size:14px;margin-top:6px}

.parent-level{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0}
.pl-step{display:flex;align-items:center;gap:8px}
.pl-step button{width:44px;height:44px;border-radius:12px;border:2px solid #233f43;background:#fff;font-size:22px;font-weight:800}
.pl-step button:disabled{opacity:.35}
.pl-step span{min-width:120px;text-align:center;font-weight:800}

.level-up .lu-card{max-width:560px;text-align:center}
.lu-evo{display:flex;align-items:flex-end;justify-content:center;gap:18px;margin:10px 0}
.lu-a svg{width:auto}.lu-a.small svg{height:70px}.lu-a.big svg{height:104px}
.lu-arrow{font-size:34px;font-weight:800;align-self:center}
.lu-reward{display:flex;align-items:center;gap:12px;background:#fff7de;border-radius:18px;padding:8px 14px;text-align:left;margin:8px 0}
.lu-gold svg{height:56px;width:auto}
.lu-reward small{display:block;color:#6d817d}
.lu-actions{display:flex;gap:10px;justify-content:center;margin-top:10px;flex-wrap:wrap}
.gold-friend{filter:sepia(1) saturate(5) hue-rotate(-12deg) brightness(1.05) drop-shadow(0 0 4px #f2c14e)}
.sticker.levelgold .sticker-art{box-shadow:0 0 0 3px #f2c14e inset}

@media (max-width:700px){
  .lv-btn{min-height:104px}.lv-size1 svg{height:34px}.lv-size2 svg{height:40px}.lv-size3 svg{height:46px}.lv-size4 svg{height:52px}.lv-size5 svg{height:58px}
  .lv-art{height:60px}.lv-name{font-size:11px}.lv-count{font-size:11px}
  .lc-dot{width:40px}.level-chip b{font-size:14px}
}

.sticker.levelgold{border-color:#e0b24a;background:linear-gradient(180deg,#fff6d8,#fffaf0 55%);padding-top:30px!important}
.sticker.levelgold.locked{border-style:dashed;border-color:#d3a846;background:linear-gradient(180deg,#f6ecd0,#e6e4d6)}
.sticker.levelgold.locked .sticker-art>i{background:#eadbb0}
.lu-stay{background:#fff!important;color:#233f43!important;border:2px solid #233f43!important;box-shadow:none!important}

/* portrait (phones, iPad upright): the three mission tasks and the three islands each sit in one row */
@media (orientation:portrait){
  #hub .hub-base{gap:12px}
  #hub #missionBar{grid-template-columns:1fr;gap:8px;padding:10px 12px}
  #hub #missionBar .mission-tasks{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px}
  #hub #missionBar .mission-task{flex-direction:column;align-items:center;justify-content:flex-start;gap:4px;min-height:0;padding:8px 4px;text-align:center}
  #hub #missionBar .mt-icon{width:34px;height:34px;font-size:19px}
  #hub #missionBar .mt-text{align-items:center;width:100%}
  #hub #missionBar .mt-text small{font-size:10px;max-width:100%}
  #hub #missionBar .mt-text b{font-size:12px;line-height:1.2;-webkit-line-clamp:2;word-break:break-word}
  #hub #missionBar .mt-text em{font-size:11px}
  #hub .worlds{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px}
  #hub .world{border-radius:18px}
  #hub .world .scene{height:clamp(92px,26vw,170px)}
  #hub .world .scene .tag{display:none}
  #hub .world .scene .animal{transform:none!important}
  #hub .world .scene .a1{width:58%!important;left:6%!important;top:26%!important}
  #hub .world .scene .a2{width:34%!important;left:60%!important;top:46%!important}
  .lv-no,.lv-an{display:block}
  #hub .world-label{padding:8px 8px 10px;flex-direction:column;align-items:flex-start;gap:4px}
  #hub .world-label h2{font-size:clamp(15px,4.4vw,22px);margin:0}
  #hub .world-label small{font-size:11px}
  #hub .world-label .arrow{display:none}
  #hub .world-progress{margin:0;min-width:0;width:100%;align-items:flex-start}
  #hub .wp-bar{width:100%;height:9px}
  #hub .world-progress em{font-size:11px}
  .lv-btn{padding:12px 2px 6px}
}

/* ===== iPad landscape (the main use): every screen fills the screen, nothing to scroll ===== */
@media (orientation:landscape) and (min-width:900px) and (min-height:600px){
  /* home */
  main.viewport{margin-bottom:0!important;border-radius:0!important;padding-bottom:0!important}
  #hub.active{height:calc(100dvh - 62px);padding:12px 8px 10px!important;min-height:0!important;display:flex}
  #hub .hub-base{flex:1;min-height:0;height:100%;gap:12px}
  #hub #missionBar{padding:10px 16px;margin:0}
  #hub .mission-task{min-height:64px;padding:6px 12px}
  #hub .level-bar{padding:8px 14px 6px}
  #hub .lv-btn{min-height:0;padding:12px 6px 6px}
  #hub .lv-art{height:clamp(46px,8.5vh,78px)}
  #hub .lv-size1 svg{height:clamp(34px,6vh,54px)}#hub .lv-size2 svg{height:clamp(40px,7vh,62px)}#hub .lv-size3 svg{height:clamp(46px,8vh,72px)}#hub .lv-size4 svg{height:clamp(52px,9vh,82px)}#hub .lv-size5 svg{height:clamp(58px,10vh,92px)}
  #hub .worlds{flex:1;min-height:0;gap:16px}
  #hub .world{display:flex;flex-direction:column;min-height:0;height:100%}
  #hub .world .scene{flex:1 1 0;min-height:0;height:auto!important}
  #hub .world-label{flex:none;padding:12px 18px}

  /* island pages: one header row, then cards that fill the rest */
  :is(#map,#zhIsland,#englishIsland).active{display:flex;flex-direction:column;height:calc(100dvh - 62px);min-height:0!important;padding:10px 8px 10px!important}
  :is(#map,#zhIsland,#englishIsland) .map-inner{display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:auto minmax(0,1fr);column-gap:16px;align-items:center;flex:1;min-height:0;max-width:none!important;padding:0!important}
  :is(#map,#zhIsland,#englishIsland) .map-inner>.eyebrow,:is(#map,#zhIsland,#englishIsland) .map-lead,:is(#map,#zhIsland,#englishIsland) .mascot-map{display:none!important}
  :is(#map,#zhIsland,#englishIsland) .lvl-back{grid-column:1;grid-row:1;margin:0}
  :is(#map,#zhIsland,#englishIsland) .map-h{grid-column:2;grid-row:1;margin:0!important;font-size:clamp(22px,2.6vw,30px)!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  :is(#map,#zhIsland,#englishIsland) .map-h br{display:none}
  :is(#map,#zhIsland,#englishIsland) .level-chip{grid-column:3;grid-row:1;margin:0!important}
  :is(#map,#zhIsland,#englishIsland) .level-chip>b{display:none}
  :is(#map,#zhIsland,#englishIsland) .cards{grid-column:1/-1;grid-row:2;align-self:stretch;display:grid!important;grid-template-columns:repeat(var(--cols,4),minmax(0,1fr))!important;grid-auto-rows:minmax(0,1fr);gap:14px!important;margin:10px 0 0!important;min-height:0}
  :is(#map,#zhIsland,#englishIsland) .card[hidden]{display:none!important}
  :is(#map,#zhIsland,#englishIsland) .cards.single{width:min(680px,56%)!important;justify-self:center;margin-inline:auto!important}
  :is(#map,#zhIsland) .card:not([hidden]),#englishIsland .card:not([hidden]){display:flex!important;flex-direction:column;min-height:0;height:100%;padding:0!important;text-align:left}
  :is(#map,#zhIsland) .game-picture,#englishIsland .wb-card-picture{flex:1 1 0;min-height:0;height:auto!important;display:block}
  :is(#map,#zhIsland) .game-picture svg,#englishIsland .wb-card-picture svg{width:100%;height:100%}
  :is(#map,#zhIsland,#englishIsland) .card .card-txt{flex:none;padding:10px 14px 6px!important}
  :is(#map,#zhIsland,#englishIsland) .card .card-txt em{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  :is(#map,#zhIsland,#englishIsland) .card .go{flex:none;align-self:flex-start;margin:0 14px 12px!important}

  /* stage menus: big tiles that use the height */
  :is(#levels,#block,#zlisten,#quest,#math-extra,#workbook) .stage-grid{align-content:start}
  :is(#levels,#block,#zlisten,#quest,#math-extra,#workbook) .stage-tile{min-height:clamp(250px,44vh,400px)}
  :is(#levels,#block,#zlisten,#quest,#math-extra,#workbook) .stage-grid:has(.stage-tile:nth-of-type(6)) .stage-tile{min-height:clamp(150px,24vh,230px)}
  :is(#levels,#block,#zlisten,#quest,#math-extra,#workbook) .stage-creature{width:clamp(96px,11vw,170px);height:clamp(72px,8.4vw,128px)}
  :is(#levels,#block,#zlisten,#quest,#math-extra,#workbook) .stage-grid:has(.stage-tile:nth-of-type(6)) .stage-creature{width:clamp(70px,7vw,110px);height:clamp(52px,5.4vw,84px)}
}
