/* v0.5: cloud-backed header, compact crew cards, and a three-face toy die.
   This file changes presentation only; rules and interaction IDs are retained. */
:root{--flight-header-height:68px}
header{height:var(--flight-header-height);isolation:isolate;overflow:hidden;background:linear-gradient(90deg,#f5fbff 0%,#dcf0ff 20%,#6fb8f3 36%,#5aacf1 62%,#d4edff 82%,#f8fcff 100%);border-bottom:2px solid #fff;box-shadow:0 2px 7px #1e6caa28;padding:0 23px}
header:before,header:after{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;background-repeat:no-repeat}
header:before{background-image:url('assets/cloud-bank.png'),url('assets/cloud-bank.png');background-size:440px auto,550px auto;background-position:24% 39%,82% 47%;opacity:.94}
header:after{background:linear-gradient(90deg,#fff9 0%,#fff0 30%,#fff0 68%,#ffffffe6 94%)}
.brand{font-size:31px;letter-spacing:-1.1px;text-shadow:0 2px #fff,0 3px 2px #1e4a8c30}
.brand-icon{width:46px;height:46px;top:-4px}
#mode-label{font-size:19px;padding:9px 31px;min-width:260px;background:linear-gradient(#ffffffed,#d4ebffed);border:2px solid #fff;box-shadow:inset 0 1px 2px white,0 3px 5px #28659622;line-height:1.15}
header nav .icon-btn{height:40px;min-width:40px;border-radius:14px;background:linear-gradient(#fff,#e7f3ff);box-shadow:inset 0 1px white,0 2px 3px #396a9822}
@media(min-width:701px){
 .play{grid-template-columns:minmax(0,1fr) clamp(320px,28vw,480px);height:calc(100dvh - var(--flight-header-height));min-height:0}
 aside{display:flex;flex-direction:column;gap:11px;padding:15px 14px 11px;overflow-y:auto}
}
.crew-panel{padding:12px 10px 10px;border-radius:19px;background:linear-gradient(125deg,#ffffffde,#f2f8ffe6);border:1px solid #d4e8fc;box-shadow:inset 0 1px #fff,0 3px 7px #3274af0b}
.crew-head{padding:0 5px 10px}
.crew-head h2{font-size:26px;letter-spacing:-.7px}
.crew-head>span{font-size:10px}
#players{display:flex;flex-direction:column;gap:7px}
.player-row,.player-row.active{display:flex;min-height:76px;padding:9px 10px;gap:9px;border-radius:15px;border-width:1px}
.player-row{background:linear-gradient(120deg,#f6fbff,#e9f4ff);border-color:#cce2f9}
.player-row.active{background:linear-gradient(120deg,#edfaff,#dceeff);border-color:#4f9eff;box-shadow:inset 0 0 0 1px #a7d5ff,0 2px 5px #418bdc14}
.player-avatar{width:48px;height:48px;border-width:2px;box-shadow:0 2px 4px #376c9630}
.player-info{gap:5px;min-width:0;flex:1}
.name-line{gap:5px;flex-wrap:nowrap}
.name-line b{font-size:19px;letter-spacing:-.4px;max-width:none;min-width:0;line-height:1.2}
.name-line .seat-dot{width:10px;height:10px}
.name-line .type-badge{font-size:7px;letter-spacing:.1px;padding:2px 5px;flex-shrink:0;border-radius:6px}
.fleet-status{display:flex;align-items:center;gap:5px}
.fleet-plane{display:inline-flex;align-items:center;gap:3px;border:1px solid #c3d8ef;border-radius:7px;height:19px;padding:1px 5px;color:#7e9cbd;background:#f8fcff;line-height:1}
.fleet-plane i{font-size:10px;font-weight:900;font-style:normal}
.fleet-plane>span{font-size:13px;line-height:1}
.fleet-plane.flying{color:var(--seat);background:#fff;border-color:color-mix(in srgb,var(--seat),white 60%)}
.fleet-plane.done{color:white;background:var(--seat);border-color:var(--seat)}
.player-progress{display:flex;align-self:stretch;flex-direction:column;align-items:flex-end;justify-content:center;gap:7px;min-width:70px;flex:none;color:#174c91}
.player-progress small{font-size:10px;line-height:1.2;white-space:nowrap;font-weight:800;letter-spacing:0}
.current-badge{position:static;display:block;font-size:7px;font-weight:900;line-height:1;padding:5px 8px;border-radius:10px;background:linear-gradient(#318fff,#0a70f4);box-shadow:inset 0 1px #77bdff,0 2px 3px #287acc25;white-space:nowrap}
.turn-panel{flex:1 1 auto;min-height:290px;max-height:none;padding:14px;border-radius:19px;grid-template-columns:1fr;grid-template-rows:auto minmax(135px,1fr) auto auto auto;background:radial-gradient(ellipse at 52% 50%,#effbff 0%,#daefff 55%,#cae5ff 100%);border:1px solid #a2cdf3;box-shadow:inset 0 1px white,0 3px 6px #3f86c418;overflow:hidden}
.turn-panel:before,.turn-panel:after{content:'';position:absolute;z-index:0;pointer-events:none;background:url('assets/cloud-bank.png') center/contain no-repeat;width:65%;height:180px;opacity:.84}
.turn-panel:before{left:-16%;bottom:36px;transform:rotate(7deg)}
.turn-panel:after{right:-19%;bottom:45px;transform:scaleX(-1) rotate(12deg)}
.turn-panel>*{position:relative;z-index:1}
.turn-title{align-items:center;gap:7px}
.turn-title b{font-size:25px;line-height:1.2;letter-spacing:-.8px}
.turn-title b:before{width:14px;height:14px;margin-right:6px}
.turn-title span{font-size:11px;padding:6px 8px;border-radius:11px;background:#fffdf7;box-shadow:0 3px 4px #397faf20}
.dice-stage{min-height:135px;height:auto;margin:0 -5px;perspective:700px;perspective-origin:50% 48%;overflow:visible;background:radial-gradient(ellipse at center,#fff9 0%,#fff0 65%),repeating-conic-gradient(from 9deg at 50% 49%,transparent 0 15deg,#ffffff9c 15deg 19deg,transparent 19deg 42deg);mask-image:none;isolation:isolate}
.dice{--die-size:clamp(88px,7.5vw,118px);width:var(--die-size);height:var(--die-size);display:block;position:relative;flex:none;margin-top:-8px;border:0;border-radius:0;background:none;box-shadow:none;transform-style:preserve-3d;transform:rotateZ(-13deg) rotateX(21deg) rotateY(-25deg);z-index:2}
.die-face{position:absolute;inset:0;display:block;border-radius:19%;border:1px solid #fff;backface-visibility:hidden;box-shadow:inset 2px 2px 4px #fff,inset -3px -3px 6px #8a9dc333,0 0 0 1px #dbe8f9;background:linear-gradient(140deg,#fff 0%,#fff 48%,#edf4ff 85%,#d4e2f7 100%)}
.die-front{transform:translateZ(calc(var(--die-size) / 2));background:radial-gradient(ellipse at 27% 15%,#fff 30%,#f5f9ff 65%,#dce7fb 100%)}
.die-right{transform:rotateY(90deg) translateZ(calc(var(--die-size) / 2));background:linear-gradient(110deg,#e2edff,#b6caec 75%,#9db4d9);box-shadow:inset 2px 2px 3px #faffff,inset -3px -2px 6px #7693c15c}
.die-bottom{transform:rotateX(-90deg) translateZ(calc(var(--die-size) / 2));background:linear-gradient(#e2ecfd,#a1b7dc);box-shadow:inset 2px 2px 4px #eef5ff,inset -2px -4px 7px #758eb444}
.die-face:after{content:'';position:absolute;inset:3%;border:1px solid #ffffffbd;border-radius:18%;pointer-events:none}
.dice .pip{width:18%;height:18%;background:radial-gradient(circle at 42% 76%,#2c98ff 0%,#1478f4 40%,#0750c0 80%,#103e94 100%);box-shadow:inset 1px 3px 3px #043a8799,0 1px 1px #fff;border:1px solid #164baf4f;transform:translate(-50%,-50%)}
.die-right .pip,.die-bottom .pip{background:radial-gradient(circle at 40% 75%,#1763e4,#093891 90%);box-shadow:inset 1px 2px 3px #08286e,0 1px 1px #ddecff}
.dice.rolling{animation:toy-dice-roll .3s ease-in-out infinite}
.dice-shadow{position:absolute;left:50%;top:calc(50% + 64px);bottom:auto;transform:translateX(-50%);width:125px;height:20px;background:radial-gradient(ellipse,#39649a4d 0%,#39649a22 40%,transparent 72%);filter:blur(3px);z-index:0}
@keyframes toy-dice-roll{0%,100%{transform:translateY(-7px) rotateZ(-13deg) rotateX(21deg) rotateY(-25deg)}50%{transform:translateY(-28px) rotateZ(7deg) rotateX(52deg) rotateY(-53deg)}}
#action-hint{margin:7px 0 9px;font-size:13px;line-height:1.3;color:#123c8b;min-height:18px;text-shadow:0 1px white}
#piece-buttons{margin-bottom:9px;gap:7px}
#piece-buttons button{font-size:12px;padding:8px 4px;border-radius:10px}
.roll-button{min-height:51px;padding:10px;font-size:22px;border-radius:14px}
.reactions{gap:8px}
.reactions button{min-height:45px;padding:7px 0;font-size:25px;border-radius:14px}
.aside-foot{min-height:17px;font-size:8px}
.aside-foot button{font-size:10px}
@media(min-width:701px) and (max-height:850px){
 aside{padding:11px;gap:8px}
 .crew-panel{padding:9px 8px 8px}
 .crew-head{padding:0 4px 7px}
 .crew-head h2{font-size:23px}
 #players{gap:6px}
 .player-row,.player-row.active{min-height:65px;padding:7px 8px;gap:8px}
 .player-avatar{width:42px;height:42px}
 .name-line b{font-size:18px}
 .player-progress small{font-size:9px}
 .current-badge{font-size:6px;padding:4px 6px}
 .fleet-plane{height:17px;padding:1px 4px}
 .fleet-plane i{font-size:9px}
 .fleet-plane>span{font-size:11px}
 .turn-panel{min-height:254px;padding:11px;grid-template-rows:auto minmax(114px,1fr) auto auto auto}
 .turn-title b{font-size:22px}
 .dice-stage{min-height:114px}
 .dice{--die-size:84px;margin-top:-5px}
 .dice-shadow{top:calc(50% + 48px);width:100px}
 #action-hint{font-size:12px;margin:5px 0 7px}
 .roll-button{min-height:45px;font-size:20px;padding:8px}
 #piece-buttons{margin-bottom:7px}
 #piece-buttons button{padding:6px 4px;font-size:11px}
 .reactions button{min-height:40px;font-size:23px}
}
@media(min-width:701px) and (max-height:710px){
 #players{display:flex;flex-direction:column}
 .player-row,.player-row.active{min-height:53px;padding:5px 7px}
 .player-avatar{width:35px;height:35px}
 .name-line b{font-size:16px}
 .fleet-status{gap:4px}
 .fleet-plane{height:15px}
 .fleet-plane i{font-size:8px}
 .player-info{gap:3px}
 .turn-panel{min-height:228px;grid-template-rows:auto minmax(90px,1fr) auto auto auto}
 .dice-stage{min-height:90px}
 .dice{--die-size:68px}
 .dice-shadow{top:calc(50% + 39px)}
 .turn-title b{font-size:20px}
 #action-hint{font-size:11px}
 .reactions button{min-height:35px;font-size:21px}
}
@media(min-width:701px) and (max-width:1100px){
 :root{--flight-header-height:64px}
 header{padding:0 15px}
 .brand{font-size:26px;padding-left:43px}
 .brand-icon{width:39px;height:39px}
 #mode-label{font-size:15px;min-width:190px;padding:8px 19px}
 .play{grid-template-columns:minmax(0,1fr) 320px}
 aside{padding:9px;gap:8px}
 .player-row,.player-row.active{gap:6px;padding-left:7px;padding-right:7px}
 .player-avatar{width:38px;height:38px}
 .name-line{gap:4px}
 .name-line b{font-size:16px}
 .name-line .type-badge{font-size:6px;padding:2px 3px}
 .name-line .seat-dot{width:8px;height:8px}
 .player-progress{min-width:61px}
 .player-progress small{font-size:8px}
 .current-badge{font-size:6px;padding:4px 5px}
 .turn-title b{font-size:21px}
}
@media(max-width:700px){
 :root{--flight-header-height:62px}
 header{height:62px;padding:0 11px;gap:8px}
 header:before{background-size:330px auto,300px auto;background-position:0% 50%,100% 50%}
 .brand{font-size:23px;padding-left:36px;letter-spacing:-1px}
 .brand-icon{width:34px;height:34px;top:-2px}
 header nav{gap:5px}
 header nav .icon-btn{height:33px;min-width:31px;padding:0 7px;border-radius:11px;font-size:18px}
 #language{font-size:10px}
 #sound{font-size:22px}
 .top-center{display:none}
 .play{height:auto;min-height:0;overflow:visible}
 aside{display:flex;padding:10px;gap:9px;border-left:0;overflow:visible}
 .crew-panel{padding:9px 8px 8px;border-radius:17px}
 .crew-head{padding:0 3px 7px}
 .crew-head h2{font-size:20px}
 #players{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 .player-row,.player-row.active{display:grid;grid-template-columns:32px minmax(0,1fr);grid-template-rows:auto auto;gap:3px 6px;padding:7px 6px;min-height:85px;border-radius:12px}
 .player-avatar{width:32px;height:32px;grid-row:1/3;align-self:center}
 .player-info{gap:4px}
 .name-line{gap:4px}
 .name-line b{font-size:15px;line-height:1.2;max-width:none}
 .name-line .seat-dot{width:7px;height:7px}
 .name-line .type-badge{display:none}
 .fleet-status{gap:4px}
 .fleet-plane{height:16px;padding:1px 4px}
 .fleet-plane i{font-size:8px}
 .fleet-plane>span{font-size:10px}
 .player-progress{grid-column:2;min-width:0;align-items:flex-start;justify-content:center;gap:0}
 .player-progress small{font-size:8px}
 .current-badge{display:none}
 .turn-panel{flex:none;min-height:195px;grid-template-columns:108px minmax(0,1fr);grid-template-rows:auto auto auto auto;padding:12px 10px;gap:0 12px;border-radius:17px}
 .turn-panel:before{width:66%;height:130px;left:-20%;bottom:0}
 .turn-panel:after{width:66%;height:130px;right:-24%;bottom:0}
 .turn-title{grid-column:2;grid-row:1;gap:5px}
 .turn-title b{font-size:18px;letter-spacing:-.5px}
 .turn-title b:before{width:10px;height:10px;margin-right:4px}
 .turn-title span{font-size:9px;padding:5px}
 .dice-stage{grid-column:1;grid-row:1/5;min-height:157px;height:auto;background:radial-gradient(ellipse at center,#fff9,#fff0 70%);margin:0}
 .dice{--die-size:70px;margin-top:-7px}
 .dice-shadow{top:calc(50% + 42px);width:90px;height:15px}
 #action-hint{grid-column:2;font-size:11px;margin:8px 0;text-align:left}
 #piece-buttons{grid-column:2;margin-bottom:8px;gap:5px}
 #piece-buttons button{font-size:10px;padding:7px 3px}
 .roll-button{grid-column:2;min-height:44px;font-size:18px;padding:8px}
 .reactions{max-width:none;align-self:stretch;gap:7px}
 .reactions button{min-height:40px;padding:7px 0;font-size:24px}
 .aside-foot{min-height:17px;font-size:7px}
}
@media(prefers-reduced-motion:reduce){.dice.rolling{animation:none}}
/* Match the reference's simple toy portraits without changing avatar ordering. */
.player-avatar,.seat-avatar{background-image:url('assets/avatars-v5.png')}
@media(min-width:701px) and (min-height:851px){
 .player-row,.player-row.active{min-height:clamp(76px,8.4vh,92px)}
 .player-avatar{width:54px;height:54px}
 .dice{--die-size:clamp(106px,12.6vh,136px)}
 .dice-shadow{top:calc(50% + 72px);width:145px}
}
@media(min-width:1101px) and (min-height:851px){
 .player-avatar{width:clamp(48px,3.1vw,60px);height:clamp(48px,3.1vw,60px)}
 .name-line b{font-size:clamp(19px,1.25vw,24px)}
 .name-line .type-badge{font-size:clamp(8px,.48vw,9px)}
 .name-line .seat-dot{width:12px;height:12px}
 .player-progress small{font-size:clamp(10px,.68vw,13px)}
 .current-badge{font-size:clamp(8px,.48vw,9px)}
 .turn-title b{font-size:clamp(24px,1.57vw,30px)}
}
