:root {
  color: #f5f0ff;
  background: #090715;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --panel: rgba(21, 15, 42, 0.82);
  --panel-strong: rgba(33, 23, 63, 0.95);
  --line: rgba(203, 183, 255, 0.24);
  --text-soft: #cfc4ec;
  --accent: #b98cff;
  --accent-strong: #efe4ff;
  --danger: #ff9bad;
  --shadow: rgba(5, 3, 16, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(124, 88, 255, 0.38), transparent 28rem),
    radial-gradient(circle at 80% 10%, rgba(255, 120, 219, 0.18), transparent 24rem),
    linear-gradient(135deg, #05040c 0%, #110b23 46%, #070514 100%);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.52) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(190, 152, 255, 0.38) 0 1px, transparent 1.6px);
  background-position:
    0 0,
    2.4rem 3.2rem;
  background-size:
    6.4rem 6.4rem,
    9rem 9rem;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.25));
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.auth-panel {
  width: min(480px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  box-shadow: 0 24px 70px var(--shadow);
}

.brand-mark {
  display: grid;
  width: 74px;
  height: 74px;
  margin-bottom: 24px;
  place-items: center;
  border: 1px solid rgba(233, 221, 255, 0.18);
  border-radius: 50%;
  background:
    radial-gradient(circle at 62% 38%, #f8edff 0 0.56rem, transparent 0.6rem),
    radial-gradient(circle at 44% 52%, #a986ff 0 1.26rem, #5c37c6 1.34rem, transparent 1.4rem);
}

.brand-mark span {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  box-shadow: inset -10px 4px 0 #090715;
}

.eyebrow,
.game-status {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  color: #ffffff;
  font-size: clamp(2.3rem, 7vw, 4.8rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 10px;
  color: #ffffff;
  font-size: 1.35rem;
}

.intro,
.game-card p {
  color: var(--text-soft);
  line-height: 1.6;
}

.access-form {
  margin-top: 28px;
}

.access-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--accent-strong);
  font-size: 0.95rem;
  font-weight: 700;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(5, 4, 14, 0.68);
  outline: none;
}

input:focus {
  border-color: rgba(212, 188, 255, 0.78);
  box-shadow: 0 0 0 4px rgba(185, 140, 255, 0.18);
}

button,
.game-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: #150d2a;
  background: #d8c3ff;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

button:hover,
.game-link:hover,
.secondary-link:hover {
  background: #eee5ff;
  box-shadow: 0 12px 28px rgba(137, 91, 255, 0.28);
  transform: translateY(-1px);
}

.error-message {
  min-height: 1.4rem;
  margin: 12px 0 0;
  color: var(--danger);
  font-weight: 700;
}

.developer-panel {
  display: grid;
  gap: 18px;
}

.password-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 4, 14, 0.42);
}

.password-readout span,
.developer-details p,
.developer-note {
  color: var(--text-soft);
}

.password-readout strong {
  color: #ffffff;
  font-size: 2rem;
  letter-spacing: 0.08em;
}

.developer-details {
  display: grid;
  gap: 8px;
}

.developer-details p,
.developer-note {
  margin: 0;
  line-height: 1.5;
}

.developer-details strong {
  color: #ffffff;
}

.developer-form {
  display: grid;
  gap: 10px;
}

.developer-form label {
  color: var(--accent-strong);
  font-weight: 800;
}

.developer-actions {
  display: flex;
  gap: 10px;
}

.secondary-action {
  min-height: 42px;
  color: #f5f0ff;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.hub-shell {
  min-height: 100vh;
}

.hub-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 42px 0 28px;
}

.hub-header h1 {
  margin-bottom: 0;
}

.hub-section {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.hub-section > h2 {
  margin: 0;
  color: var(--accent-strong);
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lock-button {
  min-height: 42px;
  color: #f5f0ff;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 18px;
}

.collection-card,
.game-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 11, 31, 0.78);
  box-shadow: 0 18px 50px var(--shadow);
}

.collection-card,
.game-card {
  display: grid;
  min-height: 250px;
  padding: 24px;
  align-content: space-between;
  gap: 28px;
}

.game-icon {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(5, 3, 16, 0.35);
}

.game-link {
  width: max-content;
}

.collection-intro {
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 11, 31, 0.58);
}

.collection-intro p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.game-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  padding: 18px;
  grid-template-rows: auto 1fr;
  gap: 16px;
}

.game-frame-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 11, 31, 0.82);
  box-shadow: 0 18px 50px var(--shadow);
}

.game-frame-header h1 {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 2.2rem);
  line-height: 1;
}

.game-frame-header .eyebrow {
  margin-bottom: 6px;
}

.game-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.back-button,
.secondary-link {
  min-height: 42px;
  color: #f5f0ff;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.embed-wrap {
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(203, 183, 255, 0.28);
  border-radius: 8px;
  background: #05040c;
  box-shadow: 0 24px 70px var(--shadow);
}

.game-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 620px;
  border: 0;
  background: #05040c;
}

.ruffle-player {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 620px;
  place-items: center;
  color: var(--text-soft);
  background: #05040c;
}

.ruffle-player ruffle-player {
  width: 100%;
  height: 100%;
  min-height: 620px;
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 24px, 960px);
    padding: 18px 0;
  }

  .auth-panel {
    padding: 24px;
  }

  .password-row,
  .hub-header {
    grid-template-columns: 1fr;
  }

  .password-row {
    display: grid;
  }

  .password-row button,
  .game-link,
  .secondary-link {
    width: 100%;
  }

  .password-readout,
  .developer-actions {
    display: grid;
  }

  .hub-header {
    display: grid;
  }

  .lock-button {
    width: max-content;
  }

  .game-shell {
    padding: 10px;
  }

  .game-frame-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .game-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .game-frame {
    min-height: 72vh;
  }

  .ruffle-player,
  .ruffle-player ruffle-player {
    min-height: 72vh;
  }
}
