/* Extra Me v6: the Mirror's console in glass, centred on its own layer; full screen when the camera is on. Mirror-like panels, buttons and controls: frosted, with a refractive
   rim (a thin edge that catches colour), a specular highlight that follows the pointer, and pressed states that sink
   into the glass. Everything here is usable: the worlds, the powers, the gestures, the camera. */
.mirror-sec { position: relative; min-height: 100svh; padding: clamp(64px, 8.5vh, 96px) clamp(16px, 4vw, 56px) clamp(28px, 5vh, 60px); overflow: hidden; background: #070912; color: #eef2f8; isolation: isolate; }
/* what the glass refracts: the film itself, blown up and blurred behind the console, plus two soft lights */
.m-bg { position: absolute; inset: -8%; z-index: -1; width: 116%; height: 116%; filter: blur(60px) saturate(1.5) brightness(.8); opacity: .9; }
.mirror-sec::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(40% 50% at 15% 20%, rgb(108 180 238 / .28), transparent 70%), radial-gradient(40% 50% at 85% 80%, rgb(255 154 92 / .22), transparent 70%); }
.m-head { max-width: 1180px; margin: 0 auto clamp(18px, 3vh, 30px); display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .6rem 2rem; }
.m-head h2 { margin: 0; font: 360 clamp(2rem, 1.1rem + 2.4vw, 3.4rem)/.98 var(--display, Georgia); letter-spacing: -.035em; color: #fff; max-width: 22ch; }
.m-head h2 em { font-style: italic; font-weight: 300; color: #9fd2ff; }
.m-head p { margin: 0; max-width: 28rem; font-size: 15px; color: #c3cedc; }

.glass {
  position: relative; border-radius: 22px;
  background: linear-gradient(140deg, rgb(255 255 255 / .16), rgb(255 255 255 / .05) 45%, rgb(255 255 255 / .09));
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .5), inset 0 -1px 0 rgb(255 255 255 / .06), inset 1px 0 0 rgb(255 255 255 / .16), 0 30px 60px -30px rgb(0 0 0 / .7), 0 1px 2px rgb(0 0 0 / .25);
}
/* the refractive rim: a 1px edge that shifts colour round the panel, like the edge of a pane catching light */
.glass::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--rim, 210deg), rgb(255 255 255 / .75), rgb(160 210 255 / .35), rgb(255 190 225 / .4), rgb(255 255 255 / .15), rgb(190 255 230 / .35), rgb(255 255 255 / .75));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
/* the specular highlight: a soft sheen where the light (the pointer) is */
.glass::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(60% 80% at var(--sx, 30%) var(--sy, 0%), rgb(255 255 255 / .22), transparent 60%), linear-gradient(115deg, transparent 35%, rgb(255 255 255 / .07) 48%, transparent 60%); }

.console { max-width: 1180px; margin: 0 auto; padding: 14px; display: grid; grid-template-columns: 210px minmax(0, 1fr) 230px; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; }
.c-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: 8px 10px 8px 14px; border-radius: 16px; }
.c-bar .brand { display: inline-flex; align-items: center; gap: .5rem; font: 600 15px/1 var(--text, sans-serif); letter-spacing: .02em; margin-right: auto; }
.c-bar .brand i { width: 9px; height: 9px; border-radius: 50%; background: #ff5d6c; box-shadow: 0 0 0 3px rgb(255 93 108 / .2), 0 0 12px #ff5d6c; }
.c-bar .brand small { color: #a8b5c6; font-weight: 500; letter-spacing: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.status { font: 600 12px/1 var(--text, sans-serif); letter-spacing: .06em; text-transform: uppercase; padding: .55rem .8rem; border-radius: 999px; color: #cfe6ff; }
.status b { color: #fff; }

.panel { padding: 12px; border-radius: 18px; display: grid; align-content: start; gap: 6px; min-width: 0; }
.panel .list .gbtn { min-height: 34px; padding: .35rem .7rem; }
.panel h3 { margin: 4px 2px 2px; font: 700 11px/1 var(--text, sans-serif); letter-spacing: .14em; text-transform: uppercase; color: #a8b5c6; }
.panel .list { display: grid; gap: 6px; }
.panel .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
/* every control fills its column exactly: the padding sits inside the width, so nothing runs past the panel's edge */
.panel .gbtn { box-sizing: border-box; width: 100%; min-width: 0; }
.panel .grid2 .gbtn { min-height: 44px; text-align: center; text-wrap: balance; }

/* glass controls */
.gbtn { position: relative; display: inline-flex; align-items: center; justify-content: flex-start; gap: .55rem; min-height: 40px; padding: .5rem .8rem; border: 0; border-radius: 12px; cursor: pointer; color: #eef2f8; font: 600 14px/1.15 var(--text, sans-serif); text-align: left;
  background: linear-gradient(160deg, rgb(255 255 255 / .14), rgb(255 255 255 / .04)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .42), inset 0 0 0 1px rgb(255 255 255 / .14), 0 6px 14px -8px rgb(0 0 0 / .6);
  transition: transform .15s, box-shadow .2s, background .2s; }
.gbtn:hover { background: linear-gradient(160deg, rgb(255 255 255 / .22), rgb(255 255 255 / .07)); }
.gbtn:active, .gbtn.is-down { transform: translateY(1px) scale(.985); box-shadow: inset 0 2px 6px rgb(0 0 0 / .35), inset 0 0 0 1px rgb(255 255 255 / .18); }
.gbtn[aria-pressed="true"], .gbtn.is-on { background: linear-gradient(160deg, rgb(159 210 255 / .42), rgb(159 210 255 / .12)); box-shadow: inset 0 1px 0 rgb(255 255 255 / .6), inset 0 0 0 1px rgb(190 226 255 / .55), 0 0 22px -4px rgb(120 190 255 / .7); color: #fff; }
.gbtn .sw { width: 14px; height: 14px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .5); background: var(--sw, #fff); }
.gbtn kbd { margin-left: auto; font: 600 11px/1 var(--text, sans-serif); padding: .2rem .35rem; border-radius: 6px; background: rgb(255 255 255 / .1); color: #c3cedc; }
.gbtn.big { min-height: 48px; padding: .6rem 1.1rem; border-radius: 999px; font-size: 15px; justify-content: center; }
.gbtn.chip { min-height: 32px; padding: .35rem .75rem; border-radius: 999px; font-size: 13px; justify-content: center; text-align: center; }
.gbtn.gesture { flex-direction: column; align-items: flex-start; gap: .2rem; padding: .6rem .75rem; }
.gbtn.gesture small { font-weight: 500; color: #b9c6d6; font-size: 12px; }

/* the screen: the film, through the current world */
.stage { position: relative; border-radius: 20px; padding: 10px; display: grid; place-items: center; min-height: 0; }
.stage .frame { position: relative; width: min(100%, 50svh); aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px rgb(255 255 255 / .18), 0 30px 70px -30px #000; touch-action: none; cursor: crosshair; }
.stage canvas { width: 100%; height: 100%; display: block; }
.stage .power { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font: italic 300 clamp(1.8rem, 1rem + 3vw, 3.6rem)/1 var(--display, Georgia); color: #fff; text-shadow: 0 0 30px rgb(160 210 255 / .9), 0 2px 10px #000; opacity: 0; transform: scale(.9); transition: opacity .25s, transform .5s var(--out, ease); }
.stage .power.on { opacity: 1; transform: none; }
.stage .worldname { position: absolute; left: 12px; bottom: 12px; padding: .35rem .7rem; border-radius: 999px; font: 600 12px/1 var(--text, sans-serif); letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.stage .tip { position: absolute; right: 12px; top: 12px; max-width: 60%; padding: .4rem .7rem; border-radius: 12px; font: 500 12px/1.35 var(--text, sans-serif); color: #e5eef9; text-align: right; }

.dock { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 16px; }
.dock .cam-note { margin: 0; font-size: 13px; color: #b9c6d6; max-width: 34rem; flex: 1 1 18rem; }
.dock .you { width: 120px; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: rgb(0 0 0 / .4); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .18); }
.dock .you canvas { width: 100%; height: 100%; display: block; }
.dock .you[hidden] { display: none; }

/* the camera dialog, in the same glass */
.ask { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgb(5 8 14 / .45); }
.ask[hidden] { display: none; }
.ask .card { width: min(26rem, 92%); padding: 22px; border-radius: 22px; display: grid; gap: .8rem; }
.ask h4 { margin: 0; font: 360 1.7rem/1.05 var(--display, Georgia); color: #fff; }
.ask p { margin: 0; font-size: 14.5px; color: #c9d4e2; }
.ask .row { display: flex; gap: .5rem; flex-wrap: wrap; }

@media (max-width: 900px) {
  .console { grid-template-columns: 1fr; }
  .c-bar .chips { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .stage { order: -1; grid-row: 2; }
  .panel.worlds .list { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .panel.powers .grid2 { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .stage .frame { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .gbtn, .stage .power { transition: none; }
}

/* v6: a layer of the stage, the console centred in it; the camera takes it full screen */
.mirror-sec { position: fixed; inset: 0; z-index: 6; min-height: 0; display: grid; place-items: center; padding: clamp(56px, 8vh, 84px) clamp(16px, 4vw, 48px) clamp(56px, 9vh, 90px); opacity: var(--v, 0); transform: scale(calc(.96 + var(--v, 0) * .04)); filter: blur(calc((1 - var(--v, 0)) * 14px)); }
.mirror-sec .console { width: min(1120px, 100%); max-height: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dock .cam-note:empty { display: none; }
.dock { justify-content: center; }
html.mirror-full .mirror-sec { opacity: 1; transform: none; filter: none; z-index: 70; padding: 12px; }
html.mirror-full .mirror-sec .console { width: 100%; height: calc(100svh - 24px); max-width: none; grid-template-columns: 240px minmax(0, 1fr) 260px; }
/* full screen: the camera frame fills its panel exactly (same size, same corners), so it never spills over the edges */
html.mirror-full .stage .frame { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 12px; }
/* phones, full screen: just you. The bar, the camera filling the space, and the buttons; the worlds and powers step aside */
@media (max-width: 900px) {
  html.mirror-full .mirror-sec .console { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  html.mirror-full .mirror-sec .panel { display: none; }
  html.mirror-full .stage { order: 0; grid-row: 2; }
}
html.mirror-full .line, html.mirror-full .dots, html.mirror-full .back, html.mirror-full .sound, html.mirror-full .pad { opacity: 0; pointer-events: none; }
.gbtn[hidden] { display: none; }
@media (max-width: 900px) {
  /* phones: the stacked console scrolls inside its layer, clear of the running line */
  .mirror-sec { place-items: start center; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 130px; }
}
