/* =========================================================================
   Shell Full-Screen para os 3 Minigames da Comunidade (@imagenopolis)
   ========================================================================= */

:root {
  --bg: #eef4ff;
  --paper: #fffdf8;
  --ink: #181726;
  --cobalt: #1e3a8a;
  --blue: #2563eb;
  --cyan: #38bdf8;
  --yellow: #ffd23a;
  --orange: #f39a3d;
  --green: #15803d;
  --green-dark: #14532d;
  --red: #e8323c;
  --font-display: "Fredoka", "Nunito", ui-rounded, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  user-select: none;
  -webkit-user-select: none;
}

.game-shell {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 8px;
}

.game-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.shell-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2.5px solid var(--ink);
  background: #ffffff;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.1s ease, background-color 0.12s ease;
}

.shell-btn:hover { background: var(--yellow); transform: translateY(-1px); }
.shell-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.shell-btn--green { background: var(--green); color: #ffffff; }
.shell-btn--green:hover { background: var(--green-dark); }
.shell-btn--blue { background: var(--cobalt); color: #ffffff; }
.shell-btn--blue:hover { background: var(--blue); color: #ffffff; }

.hud-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hud-pill {
  padding: 5px 10px;
  border-radius: 999px;
  border: 2.5px solid var(--ink);
  background: #ffffff;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.hud-pill--yellow { background: var(--yellow); }
.hud-pill--green { background: var(--green); color: #ffffff; }
.hud-pill--red { background: var(--red); color: #ffffff; }

.stage-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: #f4f8ff;
  box-shadow: 0 6px 0 var(--ink);
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.full-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.stage-overlay {
  position: absolute;
  inset: 0;
  background: rgba(24, 23, 38, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}

.stage-overlay[hidden] {
  display: none;
}

.overlay-card {
  width: 100%;
  max-width: 440px;
  background: #fffdf8;
  border: 3.5px solid var(--ink);
  border-radius: 22px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 8px 0 var(--ink);
}

.overlay-card h1, .overlay-card h2 {
  margin: 6px 0 8px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.15;
}

.overlay-card p {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 800;
  color: rgba(24, 23, 38, 0.85);
}

.overlay-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.game-btn-lg {
  padding: 11px 18px;
  border-radius: 14px;
  border: 2.5px solid var(--ink);
  background: var(--green);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--ink);
}

.game-btn-lg--yellow { background: var(--yellow); color: var(--ink); }
.game-btn-lg--blue { background: var(--cobalt); color: #ffffff; }
.game-btn-lg--white { background: #ffffff; color: var(--ink); }
.game-btn-lg--story {
  background: linear-gradient(135deg, #2563eb 0%, #38bdf8 55%, #ffd23a 100%);
  color: var(--ink);
}

/* Modal de prévia do Story 9:16 */
.story-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(24, 23, 38, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow-y: auto;
}

.story-modal-card {
  width: 100%;
  max-width: 420px;
  max-height: 94dvh;
  overflow-y: auto;
  background: #fffdf8;
  border: 3.5px solid var(--ink);
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 10px 0 var(--ink);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.story-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.story-modal-head h2 {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 1.18rem;
  line-height: 1.15;
}

.story-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: #ffffff;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 0 var(--ink);
}

.story-preview-frame {
  display: flex;
  justify-content: center;
  background: #dbeafe;
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 10px;
}

.story-preview-img {
  width: auto;
  max-width: 100%;
  max-height: 46dvh;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  border: 2.5px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  object-fit: contain;
  background: #eef4ff;
}

.story-modal-actions {
  display: grid;
  gap: 8px;
}

.story-modal-actions .game-btn-lg {
  width: 100%;
  text-align: center;
  font-size: 0.92rem;
  padding: 10px 14px;
}

.story-modal-status {
  margin: 0;
  min-height: 18px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--green-dark);
}

.touch-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.touch-btn {
  flex: 1 1 0;
  padding: 11px 10px;
  border-radius: 14px;
  border: 2.5px solid var(--ink);
  background: #ffffff;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  touch-action: manipulation;
}

.touch-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
  background: var(--yellow);
}

.touch-btn--jump {
  background: var(--yellow);
}

@media (max-width: 560px) {
  .game-shell { padding: 6px; gap: 6px; }
  .hud-pill, .shell-btn { font-size: 0.74rem; padding: 5px 8px; }
}
