.flash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.flash-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line, #ddd);
  background: #fff;
}

.flash-cover {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #171717;
}

.flash-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.flash-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(16px, 2.5vw, 24px);
}

.flash-card h2, .flash-notes h2 {
  margin: 7px 0;
  font: 400 clamp(24px, 3vw, 32px)/1.05 var(--brush);
}

.flash-card p, .flash-notes p, .flash-status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.flash-card p { margin: 0 0 18px; }
.flash-card .flash-play { margin-top: auto; }

.flash-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid #171717;
  background: #171717;
  color: #fff;
  text-decoration: none;
  font: 600 13px/1.2 system-ui, sans-serif;
  cursor: pointer;
}

.flash-play:hover { background: var(--accent); border-color: var(--accent); }
.flash-play:disabled { cursor: wait; opacity: .8; }
.flash-console, .flash-notes { max-width: 850px; }

.flash-stage {
  position: relative;
  width: 100%;
  aspect-ratio: var(--flash-ratio);
  background: #121212;
  overflow: hidden;
}

.flash-console:is(:fullscreen, .is-expanded) {
  display: flex;
  flex-direction: column;
  max-width: none;
  padding: 8px;
  background: #121212;
}

.flash-console.is-expanded { position: fixed; inset: 0; z-index: 1000; }
body:has(.flash-console.is-expanded) { overflow: hidden; }
.flash-console:is(:fullscreen, .is-expanded) .flash-stage {
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
}
.flash-screen, .flash-start { position: absolute; inset: 0; }
.flash-screen ruffle-player { display: block; width: 100%; height: 100%; }

.flash-start {
  display: grid;
  place-items: center;
  isolation: isolate;
  background: #121212;
}

.flash-start[hidden] { display: none; }

.flash-start img {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  opacity: .55;
}

.flash-start .flash-play { border-color: #fff; font-size: 16px; }

.flash-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0 0;
}

.flash-toolbar button {
  padding: 8px 10px;
  border: 1px solid var(--line, #ddd);
  background: #fff;
  color: var(--ink);
  font: 500 12px/1.2 system-ui, sans-serif;
}

.flash-toolbar button:not(:disabled) { cursor: pointer; }
.flash-toolbar button:disabled { opacity: .48; }
.flash-toolbar button:not(:disabled):hover { color: var(--accent); }
.flash-status { margin: 8px 0 0; }
.flash-status:empty { display: none; }

.flash-notes {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--line, #ddd);
}

@media (max-width: 580px) {
  .flash-grid { grid-template-columns: 1fr; }
  .flash-toolbar button { padding: 10px; }
}
