/* Entry screen tuned per device. Loaded last; only touches #entry on non-game screens. */

/* the "view past scores" link had no grid area and landed in a half-width cell */
#entry .teacherlink{grid-area:link;margin:0;padding:6px;font-size:12px;border-style:solid;border-color:transparent;background:none;opacity:.8}
#entry:not(.hidden){grid-template-areas:"hero hero" "h1 h1" "name name" "skin skin" "create create" "code join" "err err" "link link"}

/* ---- Phones (portrait): everything must fit without scrolling ---- */
@media (max-width:599px){
  body:not(.ingame) main>section.panel{padding:10px 12px!important}
  #entry .titlehero{height:clamp(56px,13dvh,120px)}
  #entry>h1{font-size:clamp(17px,2.9dvh,22px)}
  #entry .class-picker{padding:8px 8px 6px}
  #entry .class-options span{font-size:.72rem;padding:3px 1px 5px}
  #entry .class-options img{width:min(100%,56px)}
  #entry .class-details{margin-top:6px}
  #entry .class-details p{font-size:.78rem;line-height:1.35;margin-top:2px}
  #entry #classTradeoff{display:none}
  #entry #createBtn,#entry #joinBtn{min-height:52px}
}
@media (max-width:599px) and (max-height:700px){
  #entry .class-details{display:none}
  #entry .titlehero{height:clamp(48px,11dvh,90px)}
}

/* ---- Tablets / small laptops in portrait-ish layouts ---- */
@media (min-width:600px) and (max-width:899px), (min-width:600px) and (min-height:561px) and (max-aspect-ratio:1/1){
  body:not(.ingame) main>section#entry{width:min(100%,640px);max-width:none}
  #entry input,#entry button{min-height:52px}
  #entry .class-options img{width:min(100%,92px)}
  #entry>h1{font-size:clamp(22px,3.4dvh,30px)}
  #entry .class-options span{font-size:.9rem}
}

/* ---- Desktop / landscape tablets: two columns, use the width ---- */
@media (min-width:900px) and (min-height:600px){
  body:not(.ingame) main>section#entry{width:min(100%,1040px);max-width:none;padding:22px 26px!important}
  #entry:not(.hidden){
    column-gap:26px;row-gap:12px;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;
    grid-template-areas:
      "hero name name"
      "hero skin skin"
      "hero create create"
      "h1 code join"
      "howto err err"
      "howto link link";
    align-content:safe center;align-items:start;
  }
  #entry .titlehero{height:100%;min-height:240px;max-height:440px;border-radius:18px}
  #entry>h1{font-size:clamp(24px,3.2dvh,32px);align-self:center;margin:4px 0 0;line-height:1.25}
  body:not(.ingame) #entry>.howto{display:block!important;grid-area:howto;margin:0;align-self:start}
  #entry .howto li{font-size:13.5px}
  #entry .class-options img{width:min(100%,84px)}
  #entry .class-details p{font-size:.9rem}
  #entry input,#entry button{min-height:50px}
  #entry #createBtn{min-height:64px}
  #entry .teacherlink{text-align:left;padding-left:2px}
}
@media (min-width:900px) and (min-height:820px){
  #entry .howto summary{pointer-events:none;list-style:none}
  #entry .howto summary::-webkit-details-marker{display:none}
}
@media (min-width:1400px) and (min-height:760px){
  body:not(.ingame) main>section#entry{width:min(100%,1180px);max-width:none}
  #entry .class-options img{width:min(100%,100px)}
}

/* ---- Pointer type: bigger targets for touch, hover polish for mouse ---- */
@media (pointer:coarse){
  #entry input,#entry button,#entry .class-options span{min-height:48px}
}
@media (hover:hover){
  #entry .class-options label:hover span{border-color:#ffd17b;transform:translateY(-1px)}
  #entry .class-options span{transition:transform .12s,border-color .12s,background .12s}
}
