:root {
  color-scheme: dark;
  --bg: #170d17;
  --panel: #24151f;
  --panel-2: #321d2a;
  --text: #fff5fb;
  --muted: #e2bed0;
  --line: rgba(255, 255, 255, 0.16);
  --accent: #ff5aa5;
  --accent-2: #ffd44d;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 22% 12%, rgba(255, 90, 165, 0.24), transparent 28rem),
    linear-gradient(135deg, #130d18 0%, #25131f 45%, #4c1c38 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  min-height: 100vh;
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 24px;
  display: grid;
  align-items: center;
}

.game-panel {
  width: 100%;
}

.game-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px 14px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 54px);
  line-height: 0.95;
  letter-spacing: 0;
}

.fallback-link {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.fallback-link:hover,
.fallback-link:focus-visible {
  border-color: rgba(255, 212, 77, 0.8);
  outline: none;
}

.game-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: calc(100vh - 128px);
  min-height: 300px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.game-frame ruffle-player,
.game-frame object,
.game-frame embed {
  display: block;
  width: 100%;
  height: 100%;
}

.loading,
.error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  background: linear-gradient(135deg, var(--panel), var(--panel-2));
}

.error a {
  color: var(--accent-2);
}

@media (max-width: 640px) {
  .shell {
    padding: 14px;
    align-items: start;
  }

  .game-header {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
  }

  .fallback-link {
    width: 100%;
    text-align: center;
  }

  .game-frame {
    max-height: none;
    min-height: 240px;
  }
}
