/* Phone and narrow tablet layout for the existing Slap game. */
.skip-link{position:fixed;top:-120px;left:10px;z-index:2147483001;padding:10px 14px;background:#d6f35e;color:#142217;font:700 13px system-ui;text-decoration:none}
.skip-link:focus{top:calc(var(--campus-bar-height,44px) + 8px)}

@media(max-width:950px){
  html{overflow-x:hidden}
  body.duca-game-page{overflow-x:hidden;overflow-y:auto;user-select:none;-webkit-user-select:none}
  .duca-game-page #app{display:flex;flex-direction:column;width:100%;max-width:100%;height:auto;min-height:calc(100dvh - var(--campus-bar-height,44px));overflow:visible}
  .duca-game-page #header{display:grid;grid-template-columns:minmax(0,1fr);gap:7px;width:100%;min-width:0;height:auto;padding:9px 12px;background:#101c16;border-bottom:1px solid #345a3b;color:#f5f8ee}
  #header .header-left{min-width:0;justify-content:space-between;gap:8px}
  #header h2{min-width:0;margin:0;font:800 clamp(16px,3.5vw,21px)/1.12 system-ui,sans-serif;letter-spacing:-.03em;color:#f5f8ee;white-space:nowrap}
  #header h2 span{margin-right:3px}
  #header .current-save-badge{flex:none;max-width:30%;font-size:10px;color:#d5ead3;background:#18331f}
  #header #stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;min-width:0;gap:5px}
  #header .stat{min-width:0;padding:2px 4px;border:1px solid #36523d;border-radius:7px;background:#152a1c}
  #header .stat-value{font-size:16px;line-height:1.2;letter-spacing:0}
  #header .stat-label{font-size:9px;letter-spacing:.04em;text-align:center;line-height:1.2}
  #header #header-buttons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;width:100%;min-width:0}
  #header-buttons .btn-small{display:flex;align-items:center;justify-content:center;min-width:0;min-height:42px;padding:6px 3px!important;border-radius:8px!important;font:700 10px/1.15 system-ui,sans-serif;text-align:center;white-space:normal;overflow-wrap:anywhere}
  .duca-game-page #game-area{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:9px;width:100%;min-width:0;min-height:0;padding:12px 10px 14px;overflow:visible;background:radial-gradient(circle at 50% 44%,#183520 0%,#0d2115 55%,#09170e 100%);color:#f5f8ee}
  #game-area #palma-ranked{order:1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:5px;width:100%;min-width:0;margin:0;padding:10px;border:1px solid #b9d871;border-left:4px solid var(--acid);border-radius:10px;background:#f6f8ed;color:#15221a}
  #palma-ranked>div{grid-column:1/-1;min-width:0}
  #palma-ranked strong{font-size:13px;line-height:1.2}
  #palma-ranked p{display:none}
  #palma-ranked #palma-ranked-start,#palma-ranked #rhythm-practice-open{min-width:0;min-height:40px;width:100%;margin:0;padding:6px!important;font:700 11px/1.2 system-ui,sans-serif}
  #palma-ranked #palma-ranked-start{grid-column:1;grid-row:2}
  #palma-ranked #rhythm-practice-open{grid-column:2;grid-row:2}
  #palma-ranked #palma-ranked-beat{grid-column:1;grid-row:3;align-self:center;text-align:center;color:#31583c}
  #palma-ranked #palma-ranked-status{grid-column:2;grid-row:3;align-self:center;min-width:0;font:700 10px/1.25 system-ui,sans-serif;color:#405945;text-align:center}
  #palma-ranked.ranked-active #palma-ranked-start{grid-column:1/-1}
  #palma-ranked.ranked-active #rhythm-practice-open{display:none}
  #palma-ranked.ranked-active #palma-ranked-beat{font-size:19px;color:#214f2f}
  #game-area #slap-stage{order:2;flex:none;width:min(100%,330px);height:clamp(235px,40dvh,345px);min-height:0;margin:0;touch-action:manipulation}
  #game-area #slap-target{width:auto;max-width:100%;height:clamp(205px,35dvh,315px)}
  #game-area .energy-pedestal{max-width:83%}
  #game-area #rhythm-target-ring,#game-area #rhythm-pulse-ring{width:min(74vw,260px);height:min(74vw,260px)}
  #game-area .bottom-click-bar{order:3;max-width:100%;min-width:0;justify-content:center}
  #game-area #click-info{max-width:100%;padding:7px 10px;font-size:11px;line-height:1.25}
  #game-area #ci-synergy{display:block;font-size:10px!important}
  #game-area #lore-display{order:4;min-width:0;width:100%;max-width:100%;min-height:0;padding:7px 10px;border-color:#426848;background:#102b19}
  #game-area #lore-text{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;color:#d5e8d4;font-size:11px;line-height:1.35}
  .duca-game-page #shop-panel{flex:none;width:100%;min-width:0;height:clamp(360px,62dvh,620px);border-left:0;border-top:1px solid var(--border-color);overflow:hidden}
  #shop-tabs{min-width:0;background:#102017;border-bottom-color:#395942}
  #shop-tabs .shop-tab{min-width:0;min-height:48px;padding:8px 3px;background:#102017;color:#e0edda;font:700 11px/1.15 system-ui,sans-serif;overflow-wrap:anywhere}
  #shop-tabs .shop-tab.active{background:#24432c;color:#e4fb81;border-bottom-color:#e4fb81;text-shadow:none}
  #shop-panel .tab-content{min-width:0;min-height:0;overflow-y:auto;overscroll-behavior:contain}
  #achievements-footer{flex:none;min-height:48px;height:auto;overflow:hidden}
  .duca-game-page #start-menu-screen .menu-title{color:#d6f35e!important;text-shadow:0 0 18px #d6f35e70!important}
  .duca-game-page #start-menu-screen .menu-subtitle{color:#d1e8d0!important}
  .duca-game-page #start-menu-screen .menu-container{max-height:calc(100dvh - var(--campus-bar-height,44px) - 24px);padding:20px 16px}
  #rhythm-practice{max-height:calc(100dvh - 28px);padding:17px 19px}
  #rhythm-practice h2{margin:5px 0 10px;font-size:25px}
  #rhythm-practice p{margin:8px 0}
  #rhythm-practice #practice-pulse{width:72px;height:72px;margin:11px auto}
  #rhythm-practice #practice-pad{min-height:60px}
  #rhythm-practice .site-dialog-actions{margin-top:10px}
}

@media(max-width:550px){
  .duca-game-page #header{padding:8px 9px;gap:6px}
  #header #header-buttons{gap:4px}
  #header-buttons .btn-small{font-size:9px;min-height:40px}
  #game-area #slap-stage{height:clamp(225px,39dvh,325px)}
  #game-area #slap-target{height:clamp(200px,34dvh,290px)}
}

@media(max-width:360px){
  #header h2{font-size:15px}
  #header .current-save-badge{max-width:24%}
  #header .stat-value{font-size:14px}
  #header-buttons .btn-small{font-size:8.5px}
  #palma-ranked strong{font-size:12px}
}

@media(max-width:950px) and (orientation:landscape){
  .duca-game-page #header{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  #header #header-buttons{grid-column:1/-1;grid-template-columns:repeat(7,minmax(0,1fr))}
  .duca-game-page #game-area{display:grid;grid-template-columns:minmax(0,1fr) minmax(250px,330px);align-items:start;gap:8px}
  #game-area #palma-ranked{grid-column:1;grid-row:1}
  #game-area #slap-stage{grid-column:2;grid-row:1/span 2;height:220px}
  #game-area #slap-target{height:195px}
  #game-area .bottom-click-bar{grid-column:1;grid-row:2;width:100%}
  #game-area #lore-display{grid-column:1/-1;grid-row:3}
}
