/* MidoGames — Wii Menu skin. Real Wii assets in assets/wii/, layout adapted from
   the Wii.JS recreation (GPL-3.0). Games are channels; same /api/games data. */

:root{
  --wii-blue:#4bbde6;
  --wii-blue-deep:#2aa8d8;
  --panel:#e9edf1;
  --grey:#84868a;
  --ink:#4a4d52;
  --mb:40px;               /* MidoBar taskbar height — keep the Wii bar above it */
}

@font-face{
  font-family:'WiiRodin';
  src:url(assets/wii/fonts/rodin.ttf) format('truetype');
  font-weight:400 900; font-style:normal; font-display:swap;
}

*{ box-sizing:border-box; }
html,body{ margin:0; height:100%; overflow:hidden; }
body{
  font-family:'WiiRodin','M PLUS Rounded 1c',system-ui,sans-serif;
  background:#c9ced4;
  color:var(--ink);
  -webkit-font-smoothing:antialiased;
}
img{ max-width:100%; }

/* real Wii hand cursor (WM4K) across the whole experience */
.wii-root, .wii-root *{
  cursor:url(assets/wii/img/cursor.png?v=2) 26 2, auto;
}

/* ---------- Boot: Health & Safety ------------------------------------------- */
.boot{
  position:fixed; inset:0; z-index:100000;
  background:#f4f5f6; color:#3a3d42;
  display:flex; align-items:center; justify-content:center;
  text-align:center; padding:6vh 8vw;
  transition:opacity .6s ease, visibility .6s ease;
  cursor:pointer;
}
.boot.gone{ opacity:0; visibility:hidden; }
.boot-inner{ max-width:720px; }
.boot-warn{
  font-weight:600; letter-spacing:.03em; color:#c94b3b;
  font-size:clamp(20px,3vw,34px); margin-bottom:22px;
  display:flex; align-items:center; justify-content:center; gap:12px;
}
.boot-inner p{ font-size:clamp(14px,1.5vw,18px); line-height:1.7; color:#54585e; }
.boot-press{
  margin-top:38px; font-size:clamp(15px,1.6vw,20px); color:var(--wii-blue-deep);
  font-weight:600; animation:bootpulse 1.4s ease-in-out infinite;
}
.boot-press b{
  display:inline-block; background:var(--wii-blue); color:#fff;
  width:1.7em; height:1.7em; line-height:1.7em; border-radius:50%; margin:0 .15em;
}
@keyframes bootpulse{ 0%,100%{opacity:.55} 50%{opacity:1} }

/* ---------- Root & main menu ------------------------------------------------ */
.wii-root{
  position:fixed; inset:0;
  height:calc(100vh - var(--mb,0px));   /* leave room for the MidoBar taskbar */
  opacity:0; transition:opacity .8s ease .1s;
}
.wii-root.ready{ opacity:1; }

.main-menu{
  width:100%; height:100%;
  background-color:#e6eaed;
  background-image:url(assets/wii/img/bg-pattern.png),
    radial-gradient(125% 95% at 50% 34%, rgba(255,255,255,.65), rgba(255,255,255,0) 56%),
    linear-gradient(180deg, #eaedf0 0%, #e4e8ec 55%, #d8dde2 100%);
  background-size:26px auto, cover, cover;
  transition:transform .9s ease, opacity .5s ease;
  transform-origin:center 42%;
  display:flex; flex-direction:column;
}
body.channel-splash .main-menu{
  transform:scale(3.4); opacity:0; pointer-events:none;
}

.top-section{
  position:relative; flex:1 1 auto;
  display:flex; align-items:flex-start; justify-content:center;
  padding:4.6vh 3.4vw 0;
}

/* ---------- Channel grid ---------------------------------------------------- */
.channels{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  grid-auto-rows:1fr;
  gap:2.1vh 1.7vw;
  width:100%; max-width:1430px;
}
.channel{
  position:relative;
  aspect-ratio:340/186;
}
.chan-frame{ position:absolute; inset:0; }

.chan-frame .art,
.chan-frame .ph{
  position:absolute; inset:0; width:100%; height:100%;
  object-fit:cover; display:block;
  clip-path:polygon(2% 7%,6% 2%,52% 1%,95% 3%,98% 8%,100% 49%,98% 92%,95% 97%,50% 99%,5% 97%,2% 93%,0 50%);
  background:#fff;
}
.chan-frame .ph{
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-weight:600; font-size:1.4vw; text-align:center; padding:0 10%;
  text-shadow:0 1px 3px rgba(0,0,0,.4);
}
.chan-frame::after{           /* grey Wii border */
  content:''; position:absolute; inset:0;
  background:url(assets/wii/img/channel-border.png) center/100% 100% no-repeat;
  pointer-events:none;
}
.chan-frame .glow{            /* blue hover halo */
  position:absolute; inset:0; z-index:3;
  background:url(assets/wii/img/channel-hover.png) center/100% 100% no-repeat;
  opacity:0; transform:scale(.94);
  transition:opacity .35s ease, transform .35s ease;
}
.channel.live:hover .chan-frame .glow{ opacity:1; transform:scale(1.03); }
.channel.live .chan-frame{ cursor:pointer; }

.chan-badge{                  /* UPDATED tag */
  position:absolute; top:6%; right:5%; z-index:4;
  background:#3fbf68; color:#fff; font-size:.62vw; font-weight:600;
  padding:.25em .6em; border-radius:999px; letter-spacing:.04em;
  box-shadow:0 2px 5px rgba(0,0,0,.25);
}
.chan-dot{                    /* unmatched marker */
  position:absolute; top:8%; left:6%; z-index:4;
  width:.7vw; height:.7vw; min-width:8px; min-height:8px;
  border-radius:50%; background:#f0b429; box-shadow:0 0 0 3px rgba(255,255,255,.7);
}

/* empty slot — faint animated Wii logo */
.channel.blank .chan-frame .art{
  background:url(assets/wii/img/channel-spritesheet.png) 0 0/300% 100%;
  animation:blankshimmer .4s steps(3) infinite;
}
.channel.blank .chan-frame .glow{ display:none; }
@keyframes blankshimmer{ from{background-position-x:0} to{background-position-x:calc(300% - 1px)} }

/* fixed system channels (Party / Solo) — white titled channel like a real 1st-party channel */
.chan-frame.sys .art{
  position:absolute; inset:0; display:flex; flex-direction:column; align-items:center;
  background:linear-gradient(180deg,#ffffff 0%,#ffffff 58%,#eef1f4 100%);
  clip-path:polygon(2% 7%,6% 2%,52% 1%,95% 3%,98% 8%,100% 49%,98% 92%,95% 97%,50% 99%,5% 97%,2% 93%,0 50%);
}
.chan-frame.sys .sys-title{
  margin-top:8.5%; font-family:'WiiRodin','M PLUS Rounded 1c',sans-serif; font-weight:700;
  color:#4a97b8; font-size:1.3vw; letter-spacing:.005em; line-height:1;
  -webkit-text-stroke:.3px rgba(74,151,184,.35);
}
.chan-frame.sys .sys-ico{ flex:1; display:flex; align-items:center; justify-content:center; width:100%; }
.chan-frame.sys .sys-ico svg{ width:34%; height:auto; }

/* ---------- Page arrows & dots --------------------------------------------- */
/* real Wii blue page arrows (WM4K), floating — no housing */
.page-arrow{
  position:absolute; top:44vh; transform:translateY(-50%);
  width:78px; height:88px; border:none; background:transparent no-repeat center/contain;
  z-index:20; transition:transform .18s ease, opacity .18s ease; padding:0;
  filter:drop-shadow(0 3px 5px rgba(0,0,0,.22));
}
.page-arrow:hover{ transform:translateY(-50%) scale(1.12); }
.page-arrow:disabled{ opacity:0; pointer-events:none; }
.page-arrow.left{ left:1.8vw; background-image:url(assets/wii/img/arrow-left.png); }
.page-arrow.right{ right:1.8vw; background-image:url(assets/wii/img/arrow-right.png); }

.page-dots{
  position:absolute; bottom:1vh; left:50%; transform:translateX(-50%);
  display:flex; gap:9px; z-index:20;
}
.page-dots i{
  width:9px; height:9px; border-radius:50%; background:#b7bdc4;
  transition:background .2s ease; cursor:pointer;
}
.page-dots i.on{ background:var(--wii-blue); }

/* ---------- Bottom bar ------------------------------------------------------ */
.bottom-section{
  position:relative; flex:0 0 auto; height:200px;
  background:#d2d6db url(assets/wii/img/bottom-bg.png) repeat-x;
  background-size:auto 100%;
}
.bottom-title{
  position:absolute; inset:0;
  background:url(assets/wii/img/bottom-bar.png) center top/auto 100% no-repeat;
}
.left-button{
  position:absolute; bottom:30px; left:0;
  width:172px; height:129px;
  background:url(assets/wii/img/left-button.png) 100% 100%/100% 100% no-repeat;
}
.right-button{
  position:absolute; bottom:30px; right:0;
  width:172px; height:129px;
  background:url(assets/wii/img/right-button.png) 0 100%/100% 100% no-repeat;
}
.corner-button{ transition:transform .22s ease; z-index:30; }
.corner-button:hover{ transform:scale(1.1); }
.wii-button{
  position:absolute; bottom:48px; left:52px; width:96px; height:101px;
  background:url(assets/wii/img/wii-button.png) center/100% 100% no-repeat;
}
.mail-button{
  position:absolute; bottom:48px; right:52px; width:96px; height:101px;
  background:url(assets/wii/img/mail-button.png) center/100% 100% no-repeat;
}
/* clock + date centered in the blue-curve dip (real Wii home) */
.date{
  position:absolute; left:50%; top:26px; transform:translateX(-50%);
  text-align:center; line-height:1; z-index:6; pointer-events:none;
}
.clock-face{ display:flex; align-items:center; justify-content:center; gap:11px; height:62px; }
.clock-face img{ height:62px; width:auto; display:block; }
.clock-face img.colon{ height:50px; margin:0 4px; }
.clock-face img.ampm{ height:24px; align-self:flex-end; margin:0 0 8px 12px; }
.date .day{
  font-family:'WiiRodin','Asap',sans-serif; color:#9a9da2;
  font-size:24px; margin-top:10px; letter-spacing:.01em;
}

/* SD card slot icon beside the Wii button */
.sd-card{
  position:absolute; bottom:60px; left:168px; width:52px; height:65px;
  background:url(assets/wii/img/sd-card.png) center/contain no-repeat;
  z-index:30; transition:transform .2s ease;
}
.sd-card:hover{ transform:scale(1.08); }

/* unread badge on the mail button */
.mail-badge{
  position:absolute; bottom:2px; left:50%; transform:translateX(-50%);
  min-width:20px; height:20px; padding:0 5px; border-radius:999px;
  background:#e8564a; color:#fff; font-family:'WiiRodin',sans-serif; font-weight:700;
  font-size:13px; line-height:20px; text-align:center; z-index:31;
  box-shadow:0 1px 3px rgba(0,0,0,.35);
}

/* ---------- Splash (opened channel) ---------------------------------------- */
.splash-screen{
  position:fixed; inset:0; z-index:400;
  background:#111 center/cover no-repeat;
  opacity:0; visibility:hidden; transform:scale(.5);
  transition:opacity .5s ease, transform .5s ease, visibility .5s;
}
body.channel-splash .splash-screen{ opacity:1; visibility:visible; transform:scale(1); }

.splash-scrim{
  position:absolute; inset:0;
  background:linear-gradient(90deg,rgba(10,12,16,.92) 0%,rgba(10,12,16,.7) 45%,rgba(10,12,16,.15) 100%);
  display:flex; align-items:center;
  padding:0 6vw 20vh;
}
.splash-info{ max-width:640px; color:#fff; }
.splash-info h1{ font-size:clamp(30px,4vw,58px); margin:0 0 .2em; font-weight:700; }
.splash-meta{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:18px; }
.splash-meta span{
  font-size:13px; padding:5px 12px; border-radius:999px;
  background:rgba(255,255,255,.14); color:#eaf6fd; font-family:'WiiRodin','Asap',sans-serif;
}
.splash-meta span.hot{ background:var(--wii-blue); color:#04222e; font-weight:600; }
.splash-desc{ font-size:16px; line-height:1.65; color:#d5dae0; margin-bottom:20px; font-family:'WiiRodin','Asap',sans-serif; max-height:26vh; overflow:auto; }
.splash-shots{ display:flex; gap:10px; overflow-x:auto; padding-bottom:8px; }
.splash-shots img{ height:92px; border-radius:8px; flex:0 0 auto; cursor:pointer; }

/* corner borders — the framed look while a channel is open */
.border{
  position:fixed; width:306px; height:230px; z-index:401;
  display:none; pointer-events:none;
}
body.channel-splash .border{ display:block; }
.border-topleft{ top:0; left:0; background:url(assets/wii/img/border-topleft.png); }
.border-topright{ top:0; right:0; background:url(assets/wii/img/border-topright.png); }
.border-bottomleft{ bottom:0; left:0; background:url(assets/wii/img/border-bottomleft.png); }
.border-bottomright{ bottom:0; right:0; background:url(assets/wii/img/border-bottomright.png); }

/* splash bottom bar with Wii Menu / Start pills */
.splash-bar{
  position:fixed; left:0; right:0; bottom:var(--mb); height:18vh; min-height:120px; z-index:402;
  background:#dfe2e6 url(assets/wii/img/bottom-bg.png) repeat-x; background-size:auto 100%;
  border-top:2px solid #b9bec4;
  display:flex; align-items:center; justify-content:center; gap:6vw;
  transform:translateY(100%); transition:transform .5s ease .1s;
}
body.channel-splash .splash-bar{ transform:translateY(0); }
.pill{
  position:relative; height:64px; min-width:230px; padding:0 34px;
  display:inline-flex; align-items:center; justify-content:center;
  font-family:'WiiRodin','Fredoka',sans-serif; font-size:24px; font-weight:600; color:#4a4a4a;
  text-decoration:none; border:none;
  background:url(assets/wii/img/btn-texture.png) center/auto 100% repeat-x;
  transition:transform .15s ease;
}
.pill::before,.pill::after{
  content:''; position:absolute; top:0; width:30px; height:100%; background-size:100% 100%;
}
.pill::before{ left:-29px; background-image:url(assets/wii/img/btn-left.png); }
.pill::after{ right:-29px; background-image:url(assets/wii/img/btn-right.png); }
.pill:hover{ transform:scale(1.08); }
.pill.go{ color:var(--wii-blue-deep); }

/* ---------- Overlay panels (Message board / Librarian) --------------------- */
.panel-wrap{
  position:fixed; inset:0; z-index:600;
  background:rgba(30,40,48,.45); backdrop-filter:blur(3px);
  display:none; align-items:center; justify-content:center; padding:4vh 4vw;
}
.panel-wrap.show{ display:flex; }
.panel{
  width:min(760px,96vw); max-height:90vh; overflow:auto;
  background:#f6f8fa; border:3px solid var(--wii-blue);
  border-radius:22px; box-shadow:0 20px 60px rgba(0,0,0,.4);
  padding:26px 30px;
}
.panel h2{
  margin:0 0 18px; font-size:26px; color:var(--wii-blue-deep); font-weight:700;
  display:flex; align-items:center; gap:12px;
}
.panel .close-x{
  margin-left:auto; width:40px; height:40px; border-radius:50%;
  border:3px solid var(--wii-blue); background:#fff; font-size:20px; line-height:1;
  color:var(--grey); cursor:pointer;
}
.panel .close-x:hover{ transform:scale(1.08); }

/* message board */
.msg{
  display:flex; gap:14px; align-items:center;
  background:#fff; border:2px solid #e2e6ea; border-radius:14px;
  padding:12px 16px; margin-bottom:12px;
}
.msg .mico{ font-size:30px; flex:0 0 auto; }
.msg .mbody{ flex:1 1 auto; min-width:0; }
.msg .mtitle{ font-weight:600; font-size:16px; color:#3a3d42; }
.msg .mtitle .tag{ font-size:12px; color:#fff; background:#3fbf68; border-radius:999px; padding:2px 9px; margin-left:8px; font-weight:600; }
.msg .mtitle .tag.new{ background:var(--wii-blue); }
.msg .mmeta{ font-size:13px; color:#8a8f96; font-family:'WiiRodin','Asap',sans-serif; margin-top:3px; }
.msg .mchange{ font-size:13px; color:#5a5e64; margin-top:6px; font-family:'WiiRodin','Asap',sans-serif; }
.msg img.cap{ width:60px; height:auto; border-radius:6px; flex:0 0 auto; }

/* librarian (ported) */
.field{ margin-bottom:18px; display:flex; flex-direction:column; gap:8px; }
.field label{ font-weight:600; color:#4a4d52; font-size:14px; }
.panel input{
  font-family:'WiiRodin','Asap',sans-serif; font-size:15px; padding:10px 14px;
  border:2px solid #d4d9de; border-radius:10px; background:#fff; outline:none;
}
.panel input:focus{ border-color:var(--wii-blue); }
.pbtn{
  font-family:'WiiRodin','Fredoka',sans-serif; font-weight:600; font-size:15px;
  padding:10px 18px; border-radius:999px; border:2px solid var(--wii-blue);
  background:var(--wii-blue); color:#fff; cursor:pointer; align-self:flex-start;
}
.pbtn.ghost{ background:#fff; color:var(--wii-blue-deep); }
.pbtn.danger{ background:#e15b4c; border-color:#e15b4c; }
.minibtn{
  font-family:'WiiRodin','Asap',sans-serif; font-size:13px; padding:6px 12px; margin-left:6px;
  border-radius:8px; border:2px solid #cfd5da; background:#fff; color:#54585e; cursor:pointer;
}
.minibtn.danger{ color:#c94b3b; border-color:#e6b3ac; }
.note{ font-size:13px; color:#8a8f96; font-family:'WiiRodin','Asap',sans-serif; }
.note.warn{ color:#b9791b; }
.jobcard,.fixrow{ background:#fff; border:2px solid #e2e6ea; border-radius:12px; padding:12px 14px; margin-bottom:10px; }
.jobcard .top{ display:flex; justify-content:space-between; font-size:14px; }
.jobcard .st{ text-transform:uppercase; font-size:11px; color:#8a8f96; }
.jobcard .st.done{ color:#3fbf68; } .jobcard .st.error{ color:#e15b4c; } .jobcard .st.downloading{ color:var(--wii-blue-deep); }
.bar-p{ height:8px; background:#e6eaee; border-radius:6px; margin:8px 0; overflow:hidden; }
.bar-p i{ display:block; height:100%; background:var(--wii-blue); }
.jobcard .sub{ display:flex; justify-content:space-between; font-size:12px; color:#8a8f96; font-family:'WiiRodin','Asap',sans-serif; }
.fixrow .q{ font-size:14px; margin-bottom:8px; }
.cands{ display:flex; flex-direction:column; gap:6px; }
.cand{ font-size:13px; padding:7px 10px; border:2px solid #e2e6ea; border-radius:8px; cursor:pointer; font-family:'WiiRodin','Asap',sans-serif; }
.cand:hover{ border-color:var(--wii-blue); }
.cand .yr{ color:#9a9da2; }

/* toast */
.toast{
  position:fixed; left:50%; bottom:calc(200px + 20px); transform:translate(-50%,20px);
  background:#2a2d31; color:#fff; padding:12px 22px; border-radius:999px;
  font-family:'WiiRodin','Asap',sans-serif; font-size:15px; opacity:0; pointer-events:none;
  transition:opacity .25s ease, transform .25s ease; z-index:900;
}
.toast.show{ opacity:1; transform:translate(-50%,0); }
.toast.ok{ background:#2f8f57; } .toast.err{ background:#c94b3b; }

/* lightbox */
.light{ position:fixed; inset:0; z-index:950; background:rgba(0,0,0,.85); display:none; align-items:center; justify-content:center; padding:5vh 5vw; }
.light.show{ display:flex; } .light img{ max-width:100%; max-height:100%; border-radius:8px; }

.sfx{ display:none; }

/* ---------- responsive ------------------------------------------------------ */
@media (max-width:1180px){
  .chan-frame.sys .art .ico{ font-size:5vw; }
  .chan-frame.sys .art .nm{ font-size:1.8vw; }
  .chan-badge{ font-size:8px; }
}
@media (max-height:820px){
  .bottom-section{ height:150px; }
  .date .clock{ font-size:30px; } .date .day{ font-size:15px; }
  .wii-button,.mail-button{ width:74px; height:78px; bottom:40px; }
  .toast{ bottom:170px; }
}
