/* Opencloud Play — lobby + session. clean / gaming via html[data-theme] */

.play-hero .display { letter-spacing: -0.04em; }

.play-consoles__row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}
@media (max-width: 720px) {
  .play-consoles__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.play-console {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.45rem 0.45rem 0.7rem;
  border: 1px solid var(--line);
  background: var(--panel);
  text-decoration: none;
}
.play-console__shot {
  display: block;
  background: #0c0c0c;
  overflow: hidden;
  aspect-ratio: 3 / 4;
}
.play-console--win95 .play-console__shot,
.play-console--crt .play-console__shot { aspect-ratio: 4 / 3; }
.play-console__shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.play-console__code {
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0 0.3rem;
}
.play-console__blurb {
  color: var(--mute);
  font-size: 0.78rem;
  padding: 0 0.3rem;
}
.play-console.is-on {
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.play-console:hover { border-color: var(--ink); }

.play-hero .play-filters {
  margin-top: 1.15rem;
}
.play-filters__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.4rem;
}
.play-filters__leg {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}
.play-filters__sep {
  color: var(--mute);
  opacity: 0.45;
  margin: 0 0.15rem 0 0.25rem;
  user-select: none;
}

.play-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  background: var(--bg);
  text-decoration: none;
  font-size: 0.78rem;
  cursor: pointer;
}
.play-chip.is-on {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.play-grid-sec .kicker { margin-bottom: 0.7rem; }

.play-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}
@media (min-width: 1100px) {
  .play-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .play-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .play-grid { grid-template-columns: 1fr; }
}

.play-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  text-decoration: none;
  overflow: hidden;
}
.play-card:hover { border-color: var(--ink); }
.play-card__shot {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #070707;
  overflow: hidden;
}
.play-card__shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.92) contrast(1.04);
}
.play-card__shot::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0 2px,
      rgba(0, 0, 0, 0.16) 2px 3px
    ),
    linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent 42%);
  pointer-events: none;
}
.play-card__hud {
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.32rem 0.45rem;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent);
  color: #d8d8d8;
}
.play-card__code { font-weight: 600; }
.play-card__era { color: rgba(255, 255, 255, 0.55); }
.play-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.45rem 0.6rem 0.55rem;
}
.play-card__name {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.play-card__meta {
  font-size: 0.68rem;
  color: var(--mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-empty { padding: 2rem 0; }

.play-session__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.play-session__consoles { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.play-console-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  width: 4.6rem;
  text-decoration: none;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--mute);
  border: 1px solid transparent;
  padding: 0.15rem;
}
.play-console-mini img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #0c0c0c;
}
.play-console-mini.is-on {
  border-color: var(--ink);
  color: var(--ink);
}

.play-cab {
  width: min(100%, 52rem);
  margin: 0 auto;
}
.play-cab--gboy,
.play-cab--cabinet { width: min(100%, 28rem); }
.play-cab__photo {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.play-cab--gboy .play-cab__photo,
.play-cab--cabinet .play-cab__photo { aspect-ratio: 2 / 3; }
.play-cab--win95 .play-cab__photo,
.play-cab--crt .play-cab__photo { aspect-ratio: 3 / 2; }
.play-cab__shell {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}
.play-cab__tools {
  position: absolute;
  z-index: 4;
  top: 2.5%;
  right: 3%;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.play-cab__title {
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  background: rgba(8, 8, 8, 0.62);
  color: #f4f4f4;
}
.play-cab__btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(8, 8, 8, 0.62);
  color: #f4f4f4;
  padding: 0.15rem 0.5rem;
  cursor: pointer;
}
.play-cab__btn[aria-pressed="true"] {
  border-color: #b8ff3c;
  color: #b8ff3c;
}
.play-cab__lcd {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #000;
  overflow: hidden;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.85);
}
.play-cab--gboy .play-cab__lcd {
  left: 28.2%;
  top: 24.0%;
  width: 44.2%;
  height: 27.2%;
}
.play-cab--cabinet .play-cab__lcd {
  left: 28.8%;
  top: 20.2%;
  width: 42.2%;
  height: 27.6%;
}
.play-cab--win95 .play-cab__lcd {
  left: 29.8%;
  top: 13.5%;
  width: 40.8%;
  height: 43.2%;
  border-radius: 1.2% / 1.6%;
}
.play-cab--crt .play-cab__lcd {
  left: 24.8%;
  top: 16.2%;
  width: 48.4%;
  height: 51.2%;
  border-radius: 5% / 6%;
}
.play-cab__hud {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.18rem 0.35rem 0.1rem;
  font-size: clamp(0.45rem, 1.4vw, 0.7rem);
  letter-spacing: 0.04em;
  color: #c8ff6a;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.play-cab__hud strong { font-variant-numeric: tabular-nums; }
.play-cab__stage {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: #000;
}
.play-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  image-rendering: pixelated;
  background: #0a0a0a;
  cursor: pointer;
  touch-action: none;
}

/* kiosk: only the machine + its glass. cover the viewport, no site chrome. */
html.is-play-max {
  --play-vh: 100vh;
  --play-vw: 100vw;
  background: #000;
}
@supports (height: 100dvh) {
  html.is-play-max {
    --play-vh: 100dvh;
    --play-vw: 100dvw;
  }
}
html.is-play-max,
html.is-play-max body.oc-body {
  overflow: hidden;
  height: var(--play-vh);
  margin: 0;
  background: #000;
  overscroll-behavior: none;
}
html.is-play-max .top,
html.is-play-max .site-footer,
html.is-play-max .play-session__nav,
html.is-play-max .play-cab__hint,
html.is-play-max .play-pad { display: none !important; }
html.is-play-max .section.play-session,
html.is-play-max .play-session__wrap,
html.is-play-max .play-session .wrap {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  width: 100% !important;
  border: 0 !important;
}
html.is-play-max .play-session {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #000;
  overflow: hidden;
}
html.is-play-max .play-cab,
html.is-play-max .play-cab--gboy,
html.is-play-max .play-cab--cabinet,
html.is-play-max .play-cab--win95,
html.is-play-max .play-cab--crt {
  position: absolute;
  inset: 0;
  width: auto !important;
  max-width: none !important;
  margin: 0;
  overflow: hidden;
  background: #000;
}
html.is-play-max .play-cab__photo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  background: #000;
}
/* portrait machines — GBOY / CABINET 2:3 cover (native photo) */
html.is-play-max .play-cab--gboy .play-cab__photo,
html.is-play-max .play-cab--cabinet .play-cab__photo {
  aspect-ratio: 2 / 3;
  width: max(var(--play-vw), calc(var(--play-vh) * 2 / 3));
  height: max(var(--play-vh), calc(var(--play-vw) * 3 / 2));
}
/* landscape machines — WIN95 / CRT 3:2 cover (native photo) */
html.is-play-max .play-cab--win95 .play-cab__photo,
html.is-play-max .play-cab--crt .play-cab__photo {
  aspect-ratio: 3 / 2;
  width: max(var(--play-vw), calc(var(--play-vh) * 3 / 2));
  height: max(var(--play-vh), calc(var(--play-vw) * 2 / 3));
}
html.is-play-max .play-cab__shell {
  display: block !important;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}
html.is-play-max .play-cab__lcd {
  position: absolute;
  z-index: 3;
}
html.is-play-max .play-cab__tools {
  position: fixed;
  z-index: 90;
  top: max(0.4rem, env(safe-area-inset-top, 0px));
  right: max(0.4rem, env(safe-area-inset-right, 0px));
}
html.is-play-max .play-cab__hud {
  font-size: clamp(0.55rem, 1.6vw, 0.85rem);
  padding: 0.25rem 0.45rem;
}
.play-cab__hint {
  margin: 0.65rem 0 0;
  text-align: center;
  color: var(--mute);
  font-size: 0.78rem;
}
.play-pad {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 0.8rem 0.85rem;
}
.play-pad button {
  min-width: 2.4rem;
  min-height: 2.4rem;
  border: 1px solid var(--line);
  background: var(--bg);
  cursor: pointer;
}
.play-locked {
  max-width: 420px;
  margin: 2rem auto;
  text-align: center;
}
.play-locked__msg { margin-bottom: 1rem; }

.play-cab--gboy .play-canvas { background: #306230; }
.play-cab--crt .play-cab__lcd {
  box-shadow: inset 0 0 28px rgba(0, 40, 0, 0.45);
}

html[data-theme="gaming"] .play-console,
html[data-theme="gaming"] .play-card {
  border-color: #2a2a2a;
  background: #101010;
}
html[data-theme="gaming"] .play-console.is-on,
html[data-theme="gaming"] .play-chip.is-on,
html[data-theme="gaming"] .play-console-mini.is-on {
  border-color: #b8ff3c;
  box-shadow: 3px 3px 0 #b8ff3c;
  background: #111;
  color: #b8ff3c;
}
html[data-theme="gaming"] .play-card:hover { border-color: #b8ff3c; }
html[data-theme="gaming"] .play-card__code { color: #b8ff3c; }
html[data-theme="gaming"] .play-card__hud { color: #b8ff3c; }
html[data-theme="gaming"] .play-card__era { color: rgba(184, 255, 60, 0.55); }
html[data-theme="gaming"] .play-cab__title { color: #b8ff3c; }
