/* ==========================================================================
   KIARALAND - STYLES & INTERFACE
   Design alegre, cartunesco, tons pastéis e componentes responsivos.
   ========================================================================== */

:root {
    --font: "Fredoka", "Baloo 2", "Nunito", "Trebuchet MS", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    --ink: #4a3550;
    --ink-soft: #7d6c8c;
    --pink: #ff6b9d;
    --pink-dark: #d6457a;
    --pink-soft: #ffe3ee;
    --blue: #5cb8ff;
    --blue-dark: #2f8fe0;
    --yellow: #ffd166;
    --yellow-dark: #e0a52e;
    --mint: #4fd19a;
    --mint-dark: #2ea878;
    --lilac: #b79cf0;
    --lilac-dark: #8a6bd6;
    --cream: #fff8ef;
    --panel: rgba(255, 255, 255, 0.93);
    --line: #f1dfea;
    --shadow: 0 10px 28px rgba(74, 40, 110, 0.18);
    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 28px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    font-family: var(--font);
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #b4e7c0;
    color: var(--ink);
}

button {
    font-family: var(--font);
    color: inherit;
}

input, select {
    user-select: text;
    -webkit-user-select: text;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.hidden {
    display: none !important;
}

kbd {
    display: inline-block;
    min-width: 20px;
    padding: 1px 6px;
    margin: 0 1px;
    border-radius: 6px;
    background: #fff3b0;
    color: var(--ink);
    font-family: var(--font);
    font-size: 0.82em;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 2px 0 #d9b84a;
}

/* ==========================================================================
   BOTÕES
   ========================================================================== */
.btn-title {
    position: relative;
    background: linear-gradient(180deg, #ff86b0 0%, var(--pink) 100%);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 12px 22px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    box-shadow: 0 5px 0 var(--pink-dark), 0 10px 18px rgba(214, 69, 122, 0.28);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
    pointer-events: auto;
    text-shadow: 0 1px 0 rgba(120, 30, 70, 0.25);
}

.btn-title:hover {
    filter: brightness(1.06);
    transform: translateY(-2px);
    box-shadow: 0 7px 0 var(--pink-dark), 0 14px 22px rgba(214, 69, 122, 0.3);
}

.btn-title:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 var(--pink-dark), 0 3px 8px rgba(214, 69, 122, 0.3);
}

.btn-title.btn-big {
    font-size: 20px;
    padding: 15px 26px;
}

.btn-title.btn-secondary {
    background: linear-gradient(180deg, #7cc8ff 0%, var(--blue) 100%);
    box-shadow: 0 5px 0 var(--blue-dark), 0 10px 18px rgba(47, 143, 224, 0.26);
    text-shadow: 0 1px 0 rgba(20, 70, 130, 0.25);
}

.btn-title.btn-secondary:hover {
    box-shadow: 0 7px 0 var(--blue-dark), 0 14px 22px rgba(47, 143, 224, 0.3);
}

.btn-title.btn-secondary:active {
    box-shadow: 0 1px 0 var(--blue-dark), 0 3px 8px rgba(47, 143, 224, 0.3);
}

.btn-title.btn-ghost {
    background: #ffffff;
    color: var(--ink);
    text-shadow: none;
    font-size: 14px;
    padding: 10px 14px;
    box-shadow: 0 4px 0 #e6d3e3, 0 8px 14px rgba(74, 40, 110, 0.1);
}

.btn-title.btn-ghost:hover {
    box-shadow: 0 6px 0 #e6d3e3, 0 12px 18px rgba(74, 40, 110, 0.12);
}

.btn-title.btn-ghost:active {
    box-shadow: 0 1px 0 #e6d3e3;
}

.btn-title.disabled,
.btn-title:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #c9c2d3;
    box-shadow: 0 5px 0 #a79fb5;
    filter: none;
    transform: none;
}

.button-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.title-menu-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.title-menu-row > * {
    flex: 1;
}

/* ==========================================================================
   TELA INICIAL (TITLE SCREEN)
   ========================================================================== */
#title-screen {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    z-index: 1000;
}

.title-card {
    position: relative;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 4px solid #ffffff;
    border-radius: 36px;
    padding: 74px 40px 30px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(120, 60, 140, 0.28), inset 0 0 0 2px var(--pink-soft);
    max-width: 480px;
    width: 100%;
}

.title-mascot {
    position: absolute;
    left: 50%;
    top: -64px;
    width: 260px;
    height: 120px;
    transform: translateX(-50%);
    pointer-events: none;
}

.title-logo {
    display: flex;
    justify-content: center;
    gap: 1px;
    font-size: clamp(38px, 9vw, 60px);
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
}

.title-logo span {
    display: inline-block;
    color: var(--pink);
    -webkit-text-stroke: 7px #ffffff;
    paint-order: stroke fill;
    text-shadow: 0 5px 0 rgba(214, 69, 122, 0.35);
    animation: logoBounce 2.4s ease-in-out infinite;
}

.title-logo span:nth-child(3n + 2) { color: #ffb347; text-shadow: 0 5px 0 rgba(224, 140, 30, 0.35); }
.title-logo span:nth-child(3n) { color: #6ecbff; text-shadow: 0 5px 0 rgba(47, 143, 224, 0.35); }
.title-logo span:nth-child(2) { animation-delay: 0.1s; }
.title-logo span:nth-child(3) { animation-delay: 0.2s; }
.title-logo span:nth-child(4) { animation-delay: 0.3s; }
.title-logo span:nth-child(5) { animation-delay: 0.4s; }
.title-logo span:nth-child(6) { animation-delay: 0.5s; }
.title-logo span:nth-child(7) { animation-delay: 0.6s; }
.title-logo span:nth-child(8) { animation-delay: 0.7s; }
.title-logo span:nth-child(9) { animation-delay: 0.8s; }

@keyframes logoBounce {
    0%, 60%, 100% { transform: translateY(0) rotate(0deg); }
    30% { transform: translateY(-7px) rotate(-3deg); }
}

.title-subtitle {
    font-size: 15px;
    color: var(--ink-soft);
    margin-bottom: 22px;
    font-weight: 500;
}

.title-menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

/* ==========================================================================
   HUD PRINCIPAL
   ========================================================================== */
#hud-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 50;
}

.hud-panel {
    position: absolute;
    pointer-events: auto;
    background: var(--panel);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 3px solid #ffffff;
    border-radius: 22px;
    padding: 10px 16px;
    box-shadow: var(--shadow), inset 0 0 0 1.5px var(--pink-soft);
}

.hud-top-left {
    top: 14px;
    left: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 10px;
}

.hud-avatar-box {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 3px var(--pink), 0 4px 10px rgba(214, 69, 122, 0.3);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--pink-soft);
}

.hud-avatar-box canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.hud-player-info h3 {
    font-size: 17px;
    color: var(--ink);
    font-weight: 700;
    line-height: 1.1;
}

.hud-meta-tags {
    display: flex;
    gap: 6px;
    margin: 4px 0 6px 0;
}

.hud-badge {
    background: var(--blue);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 999px;
    box-shadow: 0 2px 0 var(--blue-dark);
    white-space: nowrap;
}

.hud-badge-pink {
    background: var(--pink);
    box-shadow: 0 2px 0 var(--pink-dark);
}

.hud-bar-container {
    width: 118px;
    height: 11px;
    background: #efe4f1;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1.5px 2px rgba(74, 40, 110, 0.16);
}

.hud-bar-xp {
    width: 150px;
}

.hud-bar-fill {
    position: relative;
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.hud-bar-fill::after {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    top: 2px;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
}

.fill-xp { background: linear-gradient(90deg, #ffd166, #ffab4a); }
.fill-energy { background: linear-gradient(90deg, #7be0b0, #2fc48a); }
.fill-happy { background: linear-gradient(90deg, #ff9ac0, #ff5c8f); }
.fill-dad { background: linear-gradient(90deg, #8fd0ff, #3f9df0); }

.hud-bar-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-top: 2px;
}

/* Superior Direito */
.hud-top-right {
    top: 14px;
    right: 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 236px;
}

.hud-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
}

.hud-stat-label {
    white-space: nowrap;
    flex: 1;
}

.hud-stat-value {
    width: 34px;
    text-align: right;
    font-size: 11px;
    color: var(--ink-soft);
}

.hud-wallet-row {
    padding-bottom: 6px;
    border-bottom: 2px dashed var(--line);
}

.hud-wallet {
    font-size: 17px;
    color: #e8862a;
    font-weight: 700;
}

.hud-footer-row {
    padding-top: 6px;
    border-top: 2px dashed var(--line);
    color: var(--ink-soft);
    font-size: 12px;
}

.hud-goal-row {
    gap: 6px;
}

.goal-chip {
    flex: 1;
    text-align: center;
    background: #ffffff;
    border-radius: 999px;
    padding: 2px 6px;
    font-size: 12.5px;
    font-weight: 700;
    box-shadow: inset 0 0 0 1.5px var(--line);
    white-space: nowrap;
}

/* ==========================================================================
   CÂMERA E ÁLBUM
   ========================================================================== */
#camera-layer {
    position: fixed;
    inset: 0;
    z-index: 40;
    pointer-events: none;
}

#camera-layer.hidden { display: none; }

body.camera #hud-container {
    opacity: 0;
    pointer-events: none;
}

body.camera #hud-container * { pointer-events: none; }
body.camera #interaction-prompt { display: none; }

.cam-frame {
    position: absolute;
    border-radius: 18px;
    box-shadow: 0 0 0 100vmax rgba(40, 26, 60, 0.42);
    outline: 3px solid rgba(255, 255, 255, 0.92);
    pointer-events: auto;
    cursor: crosshair;
}

.cam-frame i {
    position: absolute;
    width: 26px;
    height: 26px;
    border: 4px solid #ffffff;
}

.cam-frame i:nth-child(1) { left: 10px; top: 10px; border-right: none; border-bottom: none; border-radius: 8px 0 0 0; }
.cam-frame i:nth-child(2) { right: 10px; top: 10px; border-left: none; border-bottom: none; border-radius: 0 8px 0 0; }
.cam-frame i:nth-child(3) { left: 10px; bottom: 10px; border-right: none; border-top: none; border-radius: 0 0 0 8px; }
.cam-frame i:nth-child(4) { right: 10px; bottom: 10px; border-left: none; border-top: none; border-radius: 0 0 8px 0; }

.cam-rec {
    position: absolute;
    left: 46px;
    top: 12px;
    color: #ff4d6d;
    font-size: 15px;
    animation: cam-blink 1.2s steps(2) infinite;
}

@keyframes cam-blink { 50% { opacity: 0.15; } }

.cam-target {
    position: absolute;
    left: 50%;
    top: 12px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: var(--ink);
    font-weight: 700;
    font-size: 14px;
    padding: 3px 14px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 3px 0 rgba(74, 40, 110, 0.18);
}

.cam-flash {
    position: absolute;
    inset: 0;
    background: #ffffff;
    opacity: 0;
}

.cam-flash.go { animation: cam-flash 0.4s ease-out; }
@keyframes cam-flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }

.cam-bar {
    position: absolute;
    left: 50%;
    bottom: 54px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 18px;
    pointer-events: auto;
}

.cam-btn {
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
    background: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 9px 16px;
    cursor: pointer;
    box-shadow: 0 4px 0 #ead9e8;
}

.cam-shoot {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    border: 5px solid #ffffff;
    background: rgba(255, 255, 255, 0.25);
    padding: 5px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(40, 26, 60, 0.35);
}

.cam-shoot span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(180deg, #ff8fb8, #ff5c8f);
}

.cam-shoot:active span { transform: scale(0.9); }

.cam-hint {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    background: rgba(74, 53, 80, 0.78);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 999px;
    white-space: nowrap;
    max-width: 94vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cam-polaroid {
    position: absolute;
    right: 26px;
    bottom: 120px;
    width: 190px;
    background: #ffffff;
    padding: 9px 9px 6px;
    border-radius: 6px;
    box-shadow: 0 12px 26px rgba(40, 26, 60, 0.4);
    transform: rotate(5deg);
    opacity: 0;
}

.cam-polaroid.hidden { display: none; }
.cam-polaroid img { display: block; width: 100%; border-radius: 3px; }
.cam-polaroid span { display: block; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--ink); padding-top: 5px; }
.cam-polaroid.go { animation: cam-polaroid 2.6s ease-out forwards; }

@keyframes cam-polaroid {
    0% { opacity: 0; transform: translate(-40vw, -22vh) rotate(-8deg) scale(1.5); }
    14% { opacity: 1; transform: translate(0, 0) rotate(5deg) scale(1); }
    82% { opacity: 1; transform: translate(0, 0) rotate(5deg) scale(1); }
    100% { opacity: 0; transform: translate(40px, 30px) rotate(12deg) scale(0.8); }
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 10px;
}

.album-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 7px 7px 8px;
    box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 #f1dfea;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.album-card.has { cursor: pointer; box-shadow: inset 0 0 0 2px #ffd978, 0 3px 0 #f2cf7a; }
.album-card.closed { opacity: 0.55; }
.album-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; display: block; }

.album-empty {
    aspect-ratio: 16 / 10;
    border-radius: 6px;
    border: 2.5px dashed #d9cfe3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    filter: grayscale(0.6);
    opacity: 0.7;
}

.album-cap { font-size: 12.5px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.album-where { font-size: 11px; color: var(--ink-soft); }

.album-view {
    position: absolute;
    inset: 0;
    background: rgba(40, 26, 60, 0.78);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    z-index: 3;
}

.album-view.hidden { display: none; }
.album-view img { max-width: min(92vw, 860px); max-height: 66vh; border: 10px solid #ffffff; border-radius: 8px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); image-rendering: auto; }
.album-view p { color: #ffffff; font-weight: 700; font-size: 18px; margin: 0; }
.album-view-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ==========================================================================
   ENIGMAS E VIAGEM DE TREM
   ========================================================================== */
#travel-veil {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: #ff8fb8;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.38s ease;
}

#travel-veil.on { opacity: 1; }

.puzzle-body {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 6px 0 4px;
}

.puzzle-body.won { animation: puzzle-won 0.6s ease; }
@keyframes puzzle-won { 50% { transform: scale(1.04); } }

.puzzle-status {
    min-height: 22px;
    text-align: center;
    font-weight: 700;
    color: var(--pink-dark);
    margin: 8px 0 0;
}

.puzzle-done {
    font-size: 64px;
    padding: 12px;
}

.shake { animation: puzzle-shake 0.35s ease; }
@keyframes puzzle-shake {
    20% { transform: translateX(-7px); }
    40% { transform: translateX(7px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

.simon-pad {
    width: 104px;
    height: 104px;
    border-radius: 26px;
    border: none;
    font-size: 46px;
    cursor: pointer;
    background: #ffffff;
    box-shadow: inset 0 0 0 4px var(--line), 0 6px 0 #ead9e8;
    transition: transform 0.08s, background 0.12s, box-shadow 0.12s;
}

.simon-pad.lit {
    background: #fff3b0;
    box-shadow: inset 0 0 0 5px #ffc93d, 0 6px 0 #e0a81e, 0 0 26px rgba(255, 201, 61, 0.9);
    transform: scale(1.1);
}

.quiz-option {
    min-width: 132px;
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
    padding: 14px 18px;
    border-radius: 18px;
    border: none;
    cursor: pointer;
    background: #ffffff;
    box-shadow: inset 0 0 0 3px var(--line), 0 5px 0 #ead9e8;
}

.quiz-option.big { font-size: 40px; min-width: 96px; padding: 10px 14px; }
.quiz-option.right { background: #dff6e8; box-shadow: inset 0 0 0 3px #3fc27f, 0 5px 0 #2a8f5c; }
.quiz-option:disabled { opacity: 0.4; cursor: default; }

.code-row {
    display: flex;
    gap: 14px;
    justify-content: center;
    width: 100%;
    margin-bottom: 6px;
}

.code-wheel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.code-num {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    background: #8e6fd6;
    border-radius: 999px;
    padding: 1px 9px;
}

.code-arrow {
    width: 74px;
    font-size: 16px;
    border: none;
    border-radius: 12px;
    padding: 4px 0;
    cursor: pointer;
    background: #efe7f6;
    color: #6a5a94;
}

.code-face {
    width: 74px;
    height: 74px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: inset 0 0 0 4px #b79cf0, 0 5px 0 #8e6fd6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    cursor: pointer;
    user-select: none;
}

.jig-board {
    display: grid;
    gap: 4px;
    width: min(100%, 540px);
    aspect-ratio: 3 / 2;
    padding: 6px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: inset 0 0 0 3px var(--line);
}

.jig-tile {
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background-repeat: no-repeat;
    outline: 3px solid transparent;
    transition: transform 0.1s, outline-color 0.1s;
}

.jig-tile.ok { outline-color: rgba(63, 194, 127, 0.55); }
.jig-tile.picked { outline-color: #ff5c8f; transform: scale(0.93); }

.order-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.order-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    border-radius: 16px;
    padding: 8px 14px 10px;
    box-shadow: inset 0 0 0 3px var(--line);
}

.order-cell.ok { box-shadow: inset 0 0 0 3px #3fc27f; background: #dff6e8; }
.order-num { font-size: 12px; font-weight: 700; color: #ffffff; background: #8e6fd6; border-radius: 999px; padding: 1px 9px; }
.order-icon { font-size: 38px; line-height: 1.1; }

/* Idioma: três botões com bandeirinha, no menu principal e na pausa */
.lang-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btn-lang {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    background: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 6px 13px 6px 8px;
    cursor: pointer;
    box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 #ead9e8;
}

.btn-lang.active {
    background: #fff0f6;
    box-shadow: inset 0 0 0 2.5px var(--pink), 0 3px 0 var(--pink-dark);
    color: var(--pink-dark);
}

.lang-flag {
    position: relative;
    width: 24px;
    height: 16px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(60, 40, 90, 0.2);
}

.lang-pt { background: #1f9e4a; }
.lang-pt::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 14px;
    height: 14px;
    background: #ffd91a;
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.lang-pt::after {
    content: '';
    position: absolute;
    left: 9px;
    top: 5px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1c3f94;
}

.lang-en {
    background:
        linear-gradient(#c8102e, #c8102e) center / 100% 3px no-repeat,
        linear-gradient(#c8102e, #c8102e) center / 3px 100% no-repeat,
        linear-gradient(#ffffff, #ffffff) center / 100% 7px no-repeat,
        linear-gradient(#ffffff, #ffffff) center / 7px 100% no-repeat,
        #1c3f94;
}

.lang-sv {
    background:
        linear-gradient(#fecc02, #fecc02) 0 center / 100% 4px no-repeat,
        linear-gradient(#fecc02, #fecc02) 7px 0 / 4px 100% no-repeat,
        #006aa7;
}

/* Narração desligada: o botão fica apagado e riscado */
[data-voice-toggle].off .ico,
.btn-voice.off {
    opacity: 0.5;
}

.btn-hud-action[data-voice-toggle] {
    position: relative;
}

.btn-hud-action[data-voice-toggle].off {
    background: #efe7f1;
}

.btn-hud-action[data-voice-toggle].off::after {
    content: '';
    position: absolute;
    left: 22%;
    right: 22%;
    top: 50%;
    height: 3px;
    border-radius: 2px;
    background: #e84a7a;
    transform: rotate(-38deg);
}

.voice-status {
    font-size: 12.5px;
    margin: 2px 0 0;
}

.voice-settings {
    display: flex;
    flex-direction: column;
    gap: 9px;
    text-align: left;
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    box-shadow: inset 0 0 0 2px var(--line);
}

.voice-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
}

.voice-row > span {
    flex: 0 0 96px;
}

.voice-row select {
    flex: 1;
    min-width: 0;
    font: inherit;
    padding: 6px 10px;
    border-radius: 12px;
    border: 2px solid var(--line);
    background: #fffaf3;
    color: var(--ink);
}

.seg {
    flex: 1;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.seg button {
    flex: 1;
    font: inherit;
    font-size: 12.5px;
    padding: 6px 8px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: #f4eef6;
    color: var(--ink-soft);
    white-space: nowrap;
}

.seg button.active {
    background: var(--pink);
    color: #ffffff;
    box-shadow: 0 2px 0 var(--pink-dark);
}

/* Cartões que falam quando tocados */
[data-say] {
    cursor: pointer;
}

/* Objetivos em andamento */
.hud-tracker {
    top: 128px;
    left: 14px;
    width: 252px;
    padding: 9px 13px 11px;
    cursor: pointer;
    transition: transform 0.12s;
}

.hud-tracker:hover {
    transform: translateY(-1px);
}

.tracker-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--pink-dark);
    margin-bottom: 6px;
}

.tracker-row {
    margin-bottom: 6px;
}

.tracker-row:last-child {
    margin-bottom: 0;
}

.tracker-label {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.25;
    margin-bottom: 3px;
}

.tracker-count {
    color: var(--ink-soft);
    font-size: 11px;
    white-space: nowrap;
}

.tracker-bar {
    height: 6px;
    border-radius: 999px;
    background: #efe4f1;
    overflow: hidden;
}

.tracker-bar > div {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff9ac0, #ff5c8f);
}

.tracker-row.hot .tracker-label {
    color: var(--mint-dark);
}

.tracker-row.hot .tracker-bar > div {
    background: linear-gradient(90deg, #7be0b0, #2fc48a);
}

/* Minimapa */
.hud-minimap {
    position: absolute;
    left: 14px;
    bottom: 14px;
    width: 168px;
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    filter: drop-shadow(0 8px 14px rgba(74, 40, 110, 0.28));
}

.hud-minimap canvas {
    width: 168px;
    height: 168px;
    display: block;
}

.minimap-zone {
    margin-top: -14px;
    background: var(--ink);
    color: #fff6cf;
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 12px;
    border-radius: 999px;
    border: 2px solid #ffffff;
    white-space: nowrap;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Barra de Ações Rápidas no Topo Central */
.hud-quick-buttons {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
    display: flex;
    gap: 7px;
}

.btn-hud-action {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--panel);
    border: 3px solid #ffffff;
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    box-shadow: 0 4px 0 #ead9e8, 0 8px 14px rgba(74, 40, 110, 0.12);
    transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
    white-space: nowrap;
}

.btn-hud-action .ico {
    font-size: 17px;
    line-height: 1;
}

.btn-hud-action kbd {
    font-size: 10.5px;
    min-width: 17px;
    padding: 0 5px;
}

.btn-hud-action.btn-hud-small {
    padding: 7px 10px;
}

.btn-hud-action:hover {
    background: #fff6cf;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #ead9e8, 0 12px 18px rgba(74, 40, 110, 0.14);
}

.btn-hud-action:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #ead9e8;
}

/* Prompt de Interação Inferior */
#interaction-prompt {
    position: absolute;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--ink);
    color: #fff6cf;
    border: 3px solid #fff3b0;
    border-radius: 999px;
    padding: 9px 22px 9px 12px;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(40, 20, 60, 0.35);
    animation: bouncePrompt 0.9s ease-in-out infinite alternate;
}

#interaction-prompt kbd {
    font-size: 15px;
    padding: 2px 9px;
}

@keyframes bouncePrompt {
    0% { transform: translate(-50%, 0); }
    100% { transform: translate(-50%, -6px); }
}

/* ==========================================================================
   MODAIS & POPUPS
   ========================================================================== */
.game-modal {
    position: absolute;
    inset: 0;
    background: rgba(60, 30, 90, 0.42);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 14px;
    z-index: 2000;
}

.game-modal.layer-top { z-index: 2300; }
.game-modal.layer-summary { z-index: 2500; }

.modal-content-box {
    background: var(--cream);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    width: 100%;
    max-width: 640px;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 26px 60px rgba(60, 20, 90, 0.38), inset 0 0 0 2px var(--pink-soft);
    border: 4px solid #ffffff;
    animation: popIn 0.22s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes popIn {
    from { transform: scale(0.9) translateY(12px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-content-box.box-xs { max-width: 390px; }
.modal-content-box.box-sm { max-width: 470px; }
.modal-content-box.box-md { max-width: 560px; }
.modal-content-box.box-lg { max-width: 760px; }
.modal-content-box.box-map { max-width: 840px; }
.map-tabs { max-width: 360px; margin: 0 auto 10px; }
.modal-content-box.box-minigame { max-width: 700px; padding: 12px; background: var(--ink); border-color: #fff3b0; box-shadow: 0 26px 60px rgba(60, 20, 90, 0.5); }
.modal-content-box.box-gold { box-shadow: 0 26px 60px rgba(60, 20, 90, 0.38), inset 0 0 0 3px #ffe08a; }
.modal-content-box.centered { text-align: center; }

.modal-content-box::-webkit-scrollbar { width: 10px; }
.modal-content-box::-webkit-scrollbar-thumb { background: #f3c6da; border-radius: 10px; border: 2px solid var(--cream); }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 2px dashed var(--line);
    padding-bottom: 12px;
    margin-bottom: 16px;
    text-align: left;
}

.modal-header h2 {
    color: var(--pink-dark);
    font-size: 23px;
    font-weight: 700;
    line-height: 1.15;
}

.modal-lead {
    font-size: 14px;
    color: var(--ink-soft);
    margin-bottom: 14px;
    line-height: 1.45;
}

.btn-close-modal {
    background: #ffffff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink-soft);
    cursor: pointer;
    box-shadow: 0 3px 0 #ead9e8;
    transition: background 0.15s, color 0.15s, transform 0.12s;
}

.btn-close-modal:hover {
    background: var(--pink);
    color: #ffffff;
    transform: rotate(90deg);
}

.c-red { color: var(--pink-dark); }
.c-blue { color: var(--blue-dark); }
.c-green { color: var(--mint-dark); }

/* ==========================================================================
   CRIAÇÃO DE PERSONAGEM
   ========================================================================== */
.customizer-layout {
    display: flex;
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
}

.customizer-preview {
    flex: 0 0 170px;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #cfeaff 0%, #ffe6f1 62%, #c9f0d2 62%, #b4e7c0 100%);
    box-shadow: inset 0 0 0 3px #ffffff, inset 0 0 0 5px var(--pink-soft);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
}

.customizer-preview canvas {
    width: 160px;
    height: 190px;
}

.customizer-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--ink);
    margin-bottom: 4px;
}

.field input[type="text"],
.field select {
    width: 100%;
    padding: 9px 12px;
    border-radius: 12px;
    border: 2.5px solid #f7c6d9;
    background: #ffffff;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    outline: none;
}

.field input[type="text"]:focus {
    border-color: var(--pink);
}

.choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.choice-pill {
    border: 2.5px solid #f1dfea;
    background: #ffffff;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
}

.choice-pill.active {
    border-color: var(--pink);
    background: var(--pink);
    color: #ffffff;
    box-shadow: 0 3px 0 var(--pink-dark);
}

.choice-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 2px #e6d3e3;
    cursor: pointer;
    transition: transform 0.12s;
}

.choice-swatch.active {
    box-shadow: 0 0 0 3px var(--ink);
    transform: scale(1.14);
}

/* ==========================================================================
   MODAL DE DIÁLOGOS (caixa de RPG na base da tela)
   ========================================================================== */
.game-modal.dialog-layer {
    align-items: flex-end;
    padding-bottom: 22px;
    background: linear-gradient(to top, rgba(60, 30, 90, 0.5) 0%, rgba(60, 30, 90, 0.12) 46%, rgba(60, 30, 90, 0) 70%);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.dialog-content {
    max-width: 660px;
    padding: 18px 22px 20px;
    overflow: visible;
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.dialog-box {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.dialog-portrait {
    position: relative;
    width: 88px;
    height: 88px;
    margin-top: -42px;
    border-radius: 50%;
    background: #fff3d6;
    border: 4px solid #ffffff;
    box-shadow: 0 0 0 3px var(--pink), 0 8px 16px rgba(214, 69, 122, 0.3);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dialog-portrait canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.portrait-emoji {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
}

.portrait-emoji:empty {
    display: none;
}

.dialog-body {
    flex-grow: 1;
    min-width: 0;
}

.dialog-speaker {
    display: inline-block;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    background: var(--pink);
    padding: 3px 14px;
    border-radius: 999px;
    box-shadow: 0 3px 0 var(--pink-dark);
    margin-bottom: 8px;
}

.dialog-text {
    font-size: 15.5px;
    line-height: 1.5;
    color: var(--ink);
    background: #ffffff;
    padding: 12px 15px;
    border-radius: 6px 18px 18px 18px;
    box-shadow: inset 0 0 0 2px var(--line);
    font-weight: 500;
}

.dialog-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-dialog-choice {
    background: #ffffff;
    border: 2.5px solid #f1dfea;
    border-radius: 14px;
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    box-shadow: 0 3px 0 #ead9e8;
    transition: all 0.12s;
}

.btn-dialog-choice:hover {
    background: #fff6cf;
    border-color: var(--yellow);
    box-shadow: 0 3px 0 var(--yellow-dark);
    transform: translateX(5px);
}

/* ==========================================================================
   ÍCONES DE ITENS
   ========================================================================== */
.item-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    line-height: 1;
    border-radius: 16px;
    background: linear-gradient(160deg, #fff3d6, #ffe0ee);
    box-shadow: inset 0 0 0 2px #ffffff, 0 3px 0 #f3d3e2;
}

.item-icon.cat-food { background: linear-gradient(160deg, #fff3d6, #ffe1b8); box-shadow: inset 0 0 0 2px #ffffff, 0 3px 0 #f2cf9a; }
.item-icon.cat-plush { background: linear-gradient(160deg, #ffe6f1, #ffd0e4); }
.item-icon.cat-toys { background: linear-gradient(160deg, #dff2ff, #c9e6ff); box-shadow: inset 0 0 0 2px #ffffff, 0 3px 0 #b3d6f5; }
.item-icon.cat-clothes { background: linear-gradient(160deg, #efe6ff, #dccbff); box-shadow: inset 0 0 0 2px #ffffff, 0 3px 0 #c9b6f2; }
.item-icon.cat-souvenir { background: linear-gradient(160deg, #e2f8ea, #c9f0d6); box-shadow: inset 0 0 0 2px #ffffff, 0 3px 0 #a9dfbd; }

/* ==========================================================================
   MODAL DE LOJAS
   ========================================================================== */
.shop-welcome {
    font-size: 14px;
    color: var(--ink-soft);
    font-style: italic;
    margin-bottom: 12px;
    line-height: 1.4;
}

.shop-meta-bar {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    background: #ffffff;
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: inset 0 0 0 2px var(--line);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.val-money { color: #e8862a; }
.val-patience { color: var(--blue-dark); }

.shop-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.shop-item-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 #f1dfea;
    transition: transform 0.12s, box-shadow 0.12s;
}

.shop-item-card:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 2px #ffc4dd, 0 6px 0 #f1dfea;
}

.shop-item-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.shop-item-info {
    flex: 1;
    min-width: 0;
}

.shop-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 3px;
}

.shop-item-header h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
}

.shop-item-price {
    font-weight: 700;
    color: #ffffff;
    font-size: 13px;
    white-space: nowrap;
    background: #ffab4a;
    padding: 2px 9px;
    border-radius: 999px;
    box-shadow: 0 2px 0 #d9832a;
}

.shop-item-desc {
    font-size: 12.5px;
    color: var(--ink-soft);
    line-height: 1.38;
}

.shop-btn-group {
    display: flex;
    gap: 8px;
}

.btn-beg-dad,
.btn-buy-pocket,
.btn-item-action,
.btn-apply-paint,
.btn-confirm,
.btn-cancel,
.btn-persuade {
    border: none;
    border-radius: 999px;
    padding: 9px 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.1s, filter 0.1s;
}

.btn-beg-dad:hover, .btn-buy-pocket:hover, .btn-item-action:hover, .btn-apply-paint:hover,
.btn-confirm:hover, .btn-cancel:hover, .btn-persuade:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn-beg-dad:active, .btn-buy-pocket:active, .btn-item-action:active, .btn-apply-paint:active,
.btn-confirm:active, .btn-cancel:active, .btn-persuade:active { transform: translateY(2px); }

.btn-beg-dad {
    flex: 1.5;
    background: var(--pink);
    box-shadow: 0 3px 0 var(--pink-dark);
}

.btn-buy-pocket {
    flex: 1;
    background: var(--blue);
    box-shadow: 0 3px 0 var(--blue-dark);
}

.btn-confirm { background: var(--mint); box-shadow: 0 4px 0 var(--mint-dark); font-size: 16px; padding: 12px 16px; }
.btn-persuade { background: var(--pink); box-shadow: 0 4px 0 var(--pink-dark); font-size: 15px; padding: 12px 16px; }
.btn-cancel { background: #b9aec6; box-shadow: 0 4px 0 #9287a1; font-size: 14px; padding: 10px 16px; }

/* Resposta do pai */
.big-portrait {
    position: relative;
    width: 128px;
    height: 128px;
    margin: 0 auto 12px;
}

.big-portrait canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid #ffffff;
    box-shadow: 0 0 0 3px var(--blue), 0 8px 18px rgba(47, 143, 224, 0.3);
}

.portrait-badge {
    position: absolute;
    right: -8px;
    bottom: -4px;
    font-size: 36px;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.2));
}

.dad-quote {
    font-size: 15.5px;
    color: var(--ink);
    margin-bottom: 18px;
    line-height: 1.5;
}

/* ==========================================================================
   MODAL DE INVENTÁRIO
   ========================================================================== */
.inventory-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 14px;
    padding-bottom: 4px;
}

.btn-inv-tab {
    background: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: inset 0 0 0 2px var(--line);
}

.btn-inv-tab.active {
    background: var(--pink);
    color: #ffffff;
    box-shadow: 0 3px 0 var(--pink-dark);
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

.inventory-card {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 11px;
    font-size: 12px;
    box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 #f1dfea;
}

.inventory-card .inv-body {
    flex: 1;
    min-width: 0;
}

.inventory-card .item-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--ink);
    margin-bottom: 3px;
    line-height: 1.2;
}

.inventory-card .item-desc {
    font-size: 12px;
    color: var(--ink-soft);
    margin-bottom: 8px;
    line-height: 1.35;
}

.badge-equipped {
    background: var(--yellow);
    color: var(--ink);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
    display: inline-block;
    margin-bottom: 7px;
    box-shadow: 0 2px 0 var(--yellow-dark);
}

.btn-item-action {
    width: 100%;
    background: var(--mint);
    box-shadow: 0 3px 0 var(--mint-dark);
    padding: 7px 10px;
    font-size: 13px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 28px 14px;
    color: var(--ink-soft);
    font-size: 15px;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 2px var(--line);
}

/* ==========================================================================
   PINTURA FACIAL
   ========================================================================== */
.facepaint-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
}

.facepaint-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 9px 11px;
    box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 #f1dfea;
}

.facepaint-row canvas {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--pink-soft);
}

.facepaint-info {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    color: var(--ink);
    line-height: 1.25;
}

.facepaint-info p {
    font-size: 11.5px;
    color: var(--ink-soft);
    margin-top: 2px;
}

.btn-apply-paint {
    background: var(--lilac);
    box-shadow: 0 3px 0 var(--lilac-dark);
    white-space: nowrap;
}

/* ==========================================================================
   MAPA
   ========================================================================== */
.map-canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    border-radius: 18px;
    box-shadow: 0 0 0 4px #ffffff, 0 0 0 7px #f7c6d9, 0 10px 22px rgba(74, 40, 110, 0.2);
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
    margin-top: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}

.map-legend .dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1.5px rgba(74, 53, 80, 0.4);
    vertical-align: -1px;
    margin-right: 3px;
}

.dot-ride { background: #a55eea; }
.dot-locked { background: #b9aec6; }
.dot-shop { background: #ffb347; }
.dot-you { background: #ff4d6d; }

/* ==========================================================================
   MODAL DE MISSÕES E CONQUISTAS
   ========================================================================== */
.quests-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quest-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 #f1dfea;
}

.quest-card.completed {
    background: #effbf4;
    box-shadow: inset 0 0 0 2px #a9e6c6, 0 4px 0 #c6eed9;
}

.quest-card .quest-body {
    flex: 1;
    min-width: 0;
}

.quest-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.quest-title-row h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}

.quest-badge {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    background: var(--blue);
    padding: 2px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.quest-card.completed .quest-badge {
    background: var(--mint);
}

.quest-desc {
    font-size: 12.5px;
    color: var(--ink-soft);
    margin-bottom: 8px;
    line-height: 1.38;
}

.quest-progress-bg {
    width: 100%;
    height: 10px;
    background: #efe4f1;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
    box-shadow: inset 0 1.5px 2px rgba(74, 40, 110, 0.16);
}

.quest-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff9ac0, #ff5c8f);
    border-radius: 999px;
}

.quest-card.completed .quest-progress-fill {
    background: linear-gradient(90deg, #7be0b0, #2fc48a);
}

.quest-reward {
    font-size: 12px;
    font-weight: 600;
    color: #e8862a;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

.achievement-card {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 11px;
    box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 #f1dfea;
}

.achievement-card.locked {
    filter: grayscale(0.8);
    opacity: 0.72;
}

.achievement-card.unlocked {
    background: linear-gradient(160deg, #fffbe6, #fff0c2);
    box-shadow: inset 0 0 0 2px #ffd978, 0 4px 0 #f2cf7a;
}

.achievement-card .ach-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: inset 0 0 0 2px #ffe08a, 0 3px 0 #f2cf7a;
}

.achievement-card.locked .ach-icon {
    box-shadow: inset 0 0 0 2px var(--line);
}

.achievement-card h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}

.achievement-card p {
    font-size: 12px;
    color: var(--ink-soft);
    line-height: 1.32;
}

.ach-date, .ach-locked {
    display: inline-block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 700;
}

.ach-date { color: #d98a1e; }
.ach-locked { color: var(--ink-soft); }

/* ==========================================================================
   PASSAPORTE
   ========================================================================== */
.passport-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.pass-chip {
    background: #ffffff;
    border-radius: 999px;
    padding: 5px 13px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: inset 0 0 0 2px var(--line);
}

.pass-chip strong {
    color: var(--pink-dark);
}

.pass-zone {
    font-size: 15px;
    font-weight: 700;
    color: var(--lilac-dark);
    margin: 12px 0 7px;
}

.pass-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 9px;
}

.pass-card {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 9px 11px;
    box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 #f1dfea;
}

.pass-card.stamped {
    box-shadow: inset 0 0 0 2px #ffd978, 0 3px 0 #f2cf7a;
    background: linear-gradient(160deg, #fffdf2, #fff5d6);
}

.pass-card.closed {
    opacity: 0.6;
}

.pass-stamp {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 3px dashed #d9cfe3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
}

.pass-card.stamped .pass-stamp {
    border: 3px solid #ffffff;
    background: var(--stamp);
    box-shadow: 0 0 0 2px var(--stamp);
    transform: rotate(-9deg);
}

.pass-info {
    min-width: 0;
    font-size: 13.5px;
    line-height: 1.25;
}

.pass-stars {
    color: #f0a81e;
    font-size: 15px;
    letter-spacing: 1px;
}

.pass-note {
    font-size: 11.5px;
    color: var(--ink-soft);
}

/* Coleções no Passaporte */
.col-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
}

.col-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 10px 12px 11px;
    box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 #f1dfea;
}

.col-card.done {
    box-shadow: inset 0 0 0 2px #ffd978, 0 3px 0 #f2cf7a;
    background: linear-gradient(160deg, #fffdf2, #fff5d6);
}

.col-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 7px;
}

.col-icon {
    font-size: 26px;
    line-height: 1;
}

.col-title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    line-height: 1.2;
}

.col-title span {
    font-size: 11.5px;
    color: var(--ink-soft);
}

.col-count {
    font-weight: 700;
    font-size: 14px;
    color: var(--pink-dark);
    white-space: nowrap;
}

.col-rewards {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.col-reward {
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 999px;
    background: #f4eef6;
    color: var(--ink-soft);
    white-space: nowrap;
}

.col-reward b {
    color: var(--ink);
    margin-right: 2px;
}

.col-reward.next {
    background: #ffe9f1;
    color: var(--pink-dark);
    box-shadow: inset 0 0 0 1.5px #ff9ac0;
}

.col-reward.got {
    background: #dff6e8;
    color: #2a8f5c;
}

.btn-trade {
    flex: 1;
    background: var(--lilac);
    box-shadow: 0 3px 0 var(--lilac-dark);
}

.btn-trade:disabled {
    background: #c9c2d3;
    box-shadow: 0 3px 0 #a79fb5;
    cursor: default;
}

/* ==========================================================================
   BRINQUEDO, LEVEL UP, AVISOS
   ========================================================================== */
.levelup-canvas {
    display: block;
    width: 100%;
    border-radius: 18px;
    margin-bottom: 12px;
    background: linear-gradient(180deg, #cfeaff 0%, #ffe6f1 70%, #c9f0d2 70%);
    box-shadow: inset 0 0 0 3px #ffffff;
}

/* Passeio no brinquedo */
body.riding #hud-container,
body.riding #mobile-controls {
    opacity: 0;
    pointer-events: none;
}

body.riding #hud-container *,
body.riding #mobile-controls * {
    pointer-events: none;
}

#ride-hud {
    position: absolute;
    inset: 0;
    z-index: 70;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 26px;
}

.ride-hud-top {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--panel);
    border: 3px solid #ffffff;
    border-radius: 999px;
    padding: 8px 18px;
    box-shadow: var(--shadow), inset 0 0 0 1.5px var(--pink-soft);
    max-width: 100%;
}

.ride-hud-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--pink-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ride-hud-bar {
    width: 150px;
    flex-shrink: 0;
}

.ride-hud-fun {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
}

.ride-hud-bottom {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

#ride-hud-cheer {
    min-width: 220px;
}

#ride-hud-cheer kbd {
    margin-left: 6px;
}

.levelup-title {
    color: #e8862a;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 1px;
    -webkit-text-stroke: 5px #ffffff;
    paint-order: stroke fill;
    text-shadow: 0 4px 0 rgba(224, 140, 30, 0.3);
    margin-top: -30px;
    position: relative;
}

.levelup-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.levelup-stats > div {
    flex: 1;
    background: #ffffff;
    border-radius: 16px;
    padding: 9px 6px;
    box-shadow: inset 0 0 0 2px #ffe08a;
}

.levelup-stats span {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-soft);
}

.levelup-stats strong {
    font-size: 17px;
    font-weight: 700;
}

.notice-title {
    color: var(--pink-dark);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.notice-text {
    font-size: 15px;
    color: var(--ink);
    margin-bottom: 20px;
    line-height: 1.5;
    background: #ffffff;
    border-radius: 16px;
    padding: 14px;
    box-shadow: inset 0 0 0 2px var(--line);
}

.pause-title {
    color: var(--pink-dark);
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 20px;
}

.howto {
    font-size: 14.5px;
    color: var(--ink);
    line-height: 1.7;
}

.howto ul {
    margin: 6px 0 14px 22px;
}

/* Minigames */
.minigame-canvas {
    display: block;
    width: 100%;
    border-radius: 18px;
    touch-action: none;
}

/* ==========================================================================
   RESUMO DO DIA (TELA FINAL)
   ========================================================================== */
.summary-card {
    text-align: center;
}

.summary-portraits {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 6px;
}

.summary-portraits canvas {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    border: 4px solid #ffffff;
    box-shadow: 0 0 0 3px var(--pink), 0 6px 14px rgba(214, 69, 122, 0.28);
}

.summary-portraits canvas + canvas {
    margin-left: -14px;
    box-shadow: 0 0 0 3px var(--blue), 0 6px 14px rgba(47, 143, 224, 0.28);
}

.summary-title {
    color: var(--pink-dark);
    font-size: 27px;
    font-weight: 700;
    margin-bottom: 4px;
}

.summary-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
    margin: 16px 0 20px;
    text-align: left;
}

.summary-stat-box {
    background: #ffffff;
    border-radius: 16px;
    padding: 9px 14px;
    box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 #f1dfea;
}

.summary-stat-box label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-soft);
    display: block;
}

.summary-stat-box span {
    font-size: 19px;
    font-weight: 700;
    color: var(--pink-dark);
}

/* ==========================================================================
   CONTROLES MOBILE VIRTUAIS
   ========================================================================== */
#mobile-controls {
    position: absolute;
    bottom: 18px;
    left: 18px;
    right: 18px;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 60;
}

.dpad-container {
    width: 150px;
    height: 150px;
    position: relative;
    pointer-events: auto;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.34);
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.7);
}

.dpad-btn {
    position: absolute;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 700;
    color: var(--pink-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 0 #ead9e8, 0 6px 12px rgba(74, 40, 110, 0.18);
    touch-action: none;
}

.dpad-btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #ead9e8;
    background: #fff6cf;
}

#btn-up { top: 3px; left: 51px; }
#btn-down { bottom: 3px; left: 51px; }
#btn-left { top: 51px; left: 3px; }
#btn-right { top: 51px; right: 3px; }

.action-btn-container {
    pointer-events: auto;
}

.btn-virtual-action {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: linear-gradient(180deg, #ff86b0, var(--pink));
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    border: 4px solid #ffffff;
    box-shadow: 0 6px 0 var(--pink-dark), 0 12px 20px rgba(214, 69, 122, 0.4);
    cursor: pointer;
    touch-action: none;
}

.btn-virtual-action:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--pink-dark);
}

/* Com mouse e teclado os controles de toque não aparecem */
@media (hover: hover) and (pointer: fine) {
    #mobile-controls {
        display: none !important;
    }
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
#toast-container {
    position: absolute;
    bottom: 24px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 9px;
    z-index: 3000;
    pointer-events: none;
}

.toast {
    background: #ffffff;
    color: var(--ink);
    border-left: 7px solid var(--pink);
    padding: 11px 18px 11px 14px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    box-shadow: 0 10px 24px rgba(60, 20, 90, 0.26);
    animation: slideInToast 0.32s cubic-bezier(0.2, 1.3, 0.4, 1);
    max-width: 350px;
}

.toast-success { border-left-color: var(--mint); }
.toast-warning { border-left-color: var(--yellow); }
.toast-error { border-left-color: #ff4d6d; }
.toast-info { border-left-color: var(--blue); }

.toast.fade-out {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
}

@keyframes slideInToast {
    from { transform: translateX(60px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVIDADE
   ========================================================================== */
@media (max-width: 1400px) {
    .btn-hud-action .lbl,
    .btn-hud-action kbd {
        display: none;
    }
    .btn-hud-action,
    .btn-hud-action.btn-hud-small {
        padding: 8px 11px;
    }
}

@media (max-width: 860px), (max-height: 520px) {
    .hud-panel {
        padding: 7px 10px;
        border-radius: 18px;
        border-width: 2px;
    }
    .hud-top-left {
        top: 8px;
        left: 8px;
        gap: 8px;
        padding-left: 7px;
    }
    .hud-avatar-box {
        width: 42px;
        height: 42px;
        box-shadow: 0 0 0 2px var(--pink);
    }
    .hud-player-info h3 { font-size: 14px; }
    .hud-meta-tags { margin: 2px 0 4px; gap: 4px; }
    .hud-badge { font-size: 10px; padding: 1px 7px; }
    .hud-bar-xp { width: 108px; }
    .hud-bar-label { display: none; }
    .hud-top-right {
        top: 8px;
        right: 8px;
        min-width: 0;
        gap: 5px;
    }
    .hud-stat-label .lbl { display: none; }
    .hud-stat-label { flex: 0; }
    .hud-stat-value { display: none; }
    .hud-bar-container { width: 74px; height: 9px; }
    .hud-wallet { font-size: 14px; }
    .hud-wallet-row { padding-bottom: 4px; }
    .hud-footer-row { padding-top: 4px; font-size: 11px; gap: 6px; }
    .hud-quick-buttons {
        top: auto;
        bottom: 12px;
        gap: 5px;
    }
    .btn-hud-action,
    .btn-hud-action.btn-hud-small {
        padding: 6px 8px;
        border-width: 2px;
    }
    .btn-hud-action .ico { font-size: 16px; }
    .hud-tracker {
        top: 78px;
        left: 8px;
        width: auto;
        max-width: 58vw;
        padding: 5px 10px 7px;
    }
    .tracker-title { display: none; }
    .tracker-row:nth-child(n + 2) { display: none; }
    .tracker-label { font-size: 11px; }
    .hud-minimap {
        left: auto;
        right: 8px;
        bottom: auto;
        top: 172px;
        width: 104px;
    }
    .hud-minimap canvas { width: 104px; height: 104px; }
    .minimap-zone { font-size: 10px; max-width: 120px; }
    .goal-chip { font-size: 11px; padding: 1px 4px; }
    #interaction-prompt {
        bottom: 190px;
        font-size: 14px;
        padding: 7px 16px 7px 10px;
    }
    #mobile-controls {
        bottom: 58px;
        left: 12px;
        right: 12px;
    }
    #toast-container {
        top: 112px;
        bottom: auto;
        left: 10px;
        right: 10px;
        align-items: center;
    }
    .toast { font-size: 13px; padding: 9px 14px 9px 12px; }
    #ride-hud { padding: 10px 10px 18px; }
    .ride-hud-top { gap: 8px; padding: 6px 12px; }
    .ride-hud-name { font-size: 13px; }
    .ride-hud-bar { width: 84px; }
    #ride-hud-cheer { min-width: 0; }
    #ride-hud-cheer kbd { display: none; }
    .modal-content-box { padding: 18px 16px; border-radius: 24px; }
    .modal-header h2 { font-size: 19px; }
    .title-card { padding: 64px 22px 24px; }
    .customizer-layout { flex-direction: column; }
    .customizer-preview { flex: 0 0 150px; }
    .customizer-preview canvas { width: 126px; height: 150px; }
    .summary-stats-grid { gap: 7px; }
    .summary-stat-box span { font-size: 16px; }
    .shop-items-grid, .inventory-grid, .achievements-grid, .facepaint-grid { grid-template-columns: 1fr; }
}

@media (max-height: 620px) {
    .title-card { padding-top: 56px; padding-bottom: 20px; }
    .title-mascot { top: -50px; width: 200px; height: 92px; }
    .title-subtitle { margin-bottom: 14px; }
    .title-menu-buttons { gap: 10px; }
    .btn-title.btn-big { font-size: 18px; padding: 12px 22px; }
}

/* Celular deitado: o aviso de interação fica logo acima da barra de botões */
@media (max-height: 520px) {
    #interaction-prompt {
        bottom: 60px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .title-logo span,
    #interaction-prompt,
    .modal-content-box,
    .toast {
        animation: none;
    }
}

/* ==========================================================================
   AMIGOS, QUARTO, BICHINHO, LANTERNAS, MODO FÁCIL, JOGOS SALVOS, FOTOS
   ========================================================================== */

/* Livro de Amigos */
.friend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.friend-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 8px 12px 8px 8px;
    box-shadow: inset 0 0 0 2px var(--line);
}

.friend-card.best {
    background: linear-gradient(160deg, #fff4f9, #ffe3ef);
    box-shadow: inset 0 0 0 2px #ff9ec4, 0 3px 0 #ffc2d9;
}

.friend-card canvas {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    border-radius: 16px;
    background: linear-gradient(160deg, #eaf7ff, #d9f2e6);
}

.friend-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.friend-info strong {
    font-size: 14.5px;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-hearts {
    font-size: 13px;
    letter-spacing: 1px;
}

.friend-fav {
    font-size: 12px;
    color: var(--ink-soft);
}

/* Meu Quarto e o bichinho */
.room-swatches,
.room-slot,
.room-shop {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 6px 0 12px;
}

.room-swatch {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 2px var(--line), 0 3px 0 rgba(0, 0, 0, 0.12);
    cursor: pointer;
}

.room-swatch.active {
    box-shadow: 0 0 0 3px var(--pink), 0 3px 0 rgba(0, 0, 0, 0.12);
    transform: scale(1.1);
}

.room-slot > span {
    flex: 0 0 92px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
}

.room-pick {
    width: 44px;
    height: 44px;
    font-size: 21px;
    line-height: 1;
    border-radius: 14px;
    border: none;
    background: #f4eef6;
    cursor: pointer;
}

.room-pick.active {
    background: #ffe3ef;
    box-shadow: inset 0 0 0 3px var(--pink);
}

.room-pick:disabled {
    opacity: 0.5;
    cursor: default;
}

.room-buy {
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    padding: 9px 14px;
    border-radius: 999px;
    border: none;
    background: #fff3d6;
    color: var(--ink);
    box-shadow: 0 3px 0 #f2cf9a;
    cursor: pointer;
}

.room-buy:disabled {
    background: #f1ecf3;
    color: var(--ink-soft);
    box-shadow: none;
    cursor: default;
}

.pet-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 14px;
    box-shadow: inset 0 0 0 2px var(--line);
}

.pet-box input {
    font: inherit;
    font-weight: 600;
    width: 170px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 2px solid var(--line);
    background: #fffaf3;
    color: var(--ink);
}

.pet-box .btn-title {
    width: auto;
    padding: 9px 16px;
    font-size: 14px;
}

.pet-box .room-slot {
    margin: 0;
}

.pet-mood {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-soft);
}

/* Lanternas do Grande Festival (Passaporte) */
.lantern-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.lantern-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 6px;
    border-radius: var(--radius-md);
    background: #f4eef6;
    text-align: center;
}

.lantern-cell.on {
    background: linear-gradient(170deg, #fff6d9, #ffe3ae);
    box-shadow: inset 0 0 0 2px #ffcf6b;
}

.lantern-cell canvas {
    width: 42px;
    height: 57px;
}

.lantern-cell span {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.15;
}

.lantern-cell small {
    font-size: 11px;
    color: var(--ink-soft);
}

/* Quem vai jogar? */
.slot-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.slot-label {
    flex: 0 0 100%;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    text-align: center;
}

.btn-slot {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 999px;
    border: none;
    background: #f4eef6;
    color: var(--ink-soft);
    cursor: pointer;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-slot.empty {
    background: transparent;
    box-shadow: inset 0 0 0 2px var(--line);
}

.btn-slot.active {
    background: var(--pink);
    color: #ffffff;
    box-shadow: 0 2px 0 var(--pink-dark);
}

/* Modo fácil */
.btn-easy {
    white-space: nowrap;
}

body.easy .hud-energy-row,
body.easy #hud-xp-text,
body.easy .hud-stat-value,
body.easy #hud-carrots {
    display: none;
}

.p2-row > span {
    flex: 0 0 108px;
}

.pause-title + .button-stack .voice-row {
    text-align: left;
}

/* Mochila: fantasias e presentes */
.item-icon.cat-costume { background: linear-gradient(160deg, #fff0c9, #ffd9ec); box-shadow: inset 0 0 0 2px #ffffff, 0 3px 0 #f2b9d2; }
.item-icon.cat-gift { background: linear-gradient(160deg, #e6fbe9, #fff3c9); box-shadow: inset 0 0 0 2px #ffffff, 0 3px 0 #cfe6a8; }

/* Foto do álbum: molduras e adesivos */
.album-view img {
    max-height: 52vh;
    border-width: 6px;
    cursor: pointer;
}

.album-deco {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.deco-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.deco-btn {
    width: 44px;
    height: 44px;
    font-size: 22px;
    line-height: 1;
    border-radius: 14px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

.deco-btn.active {
    background: #ffe3ef;
    box-shadow: 0 0 0 3px var(--pink);
}

.deco-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.deco-hint {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 600;
}

.album-view-btns .btn-title {
    width: auto;
}

/* ==========================================================================
   TELA DE TOQUE (tablet e celular): body.touch é ligado por js/touch.js
   ========================================================================== */
html, body {
    overscroll-behavior: none;
    -webkit-touch-callout: none;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    position: fixed;
    inset: 0;
    touch-action: manipulation;
}

#game-canvas {
    touch-action: none;
}

/* A faixa do aviso também é um botão */
#interaction-prompt {
    pointer-events: auto;
    cursor: pointer;
}

/* Alavanca e botão de ação */
#mobile-controls {
    left: calc(18px + env(safe-area-inset-left, 0px));
    right: calc(18px + env(safe-area-inset-right, 0px));
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}

.stick {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    pointer-events: auto;
    touch-action: none;
    position: relative;
    background: rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.75), 0 6px 14px rgba(74, 40, 110, 0.16);
}

.stick.held {
    background: rgba(255, 255, 255, 0.42);
}

.stick-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 58px;
    height: 58px;
    margin: -29px 0 0 -29px;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffffff, #ffe3ef);
    box-shadow: 0 4px 0 #f2b9d2, 0 8px 14px rgba(214, 69, 122, 0.28);
    pointer-events: none;
}

.btn-virtual-action {
    width: 88px;
    height: 88px;
    font-size: 38px;
    line-height: 1;
    pointer-events: auto;
    opacity: 0.55;
    transition: opacity 0.15s ease, transform 0.08s ease;
}

body.can-act .btn-virtual-action {
    opacity: 1;
    animation: actPulse 0.9s ease-in-out infinite alternate;
}

@keyframes actPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

/* Um toque num computador com tela sensível também mostra os controles */
body.touch #mobile-controls:not(.hidden) {
    display: flex !important;
}

body.touch kbd,
body.touch .keys-hint {
    display: none !important;
}

/* Menos botões no alto: os pequenos ficam no menu de pausa */
body.touch .btn-hud-action .lbl {
    display: none;
}

body.touch .btn-hud-action.btn-hud-small:not([title^="Pausa"]) {
    display: none;
}

body.touch .btn-hud-action {
    padding: 8px 11px;
}

body.touch .btn-hud-action .ico {
    font-size: 21px;
}

/* O minimapa sai de baixo da alavanca: fica à direita, acima do botão de ação */
body.touch .hud-minimap {
    left: auto;
    right: calc(14px + env(safe-area-inset-right, 0px));
    top: auto;
    bottom: calc(126px + env(safe-area-inset-bottom, 0px));
    width: 132px;
}

body.touch .hud-minimap canvas {
    width: 132px;
    height: 132px;
}

body.touch #interaction-prompt {
    bottom: calc(26px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 300px);
    white-space: normal;
    text-align: center;
    font-size: 15px;
}

body.touch .hud-top-left {
    left: calc(14px + env(safe-area-inset-left, 0px));
}

body.touch .hud-tracker {
    left: calc(14px + env(safe-area-inset-left, 0px));
}

body.touch .hud-top-right {
    right: calc(14px + env(safe-area-inset-right, 0px));
}

/* Botões e escolhas maiores para o dedo */
body.touch .btn-dialog-choice {
    min-height: 48px;
    font-size: 16px;
}

body.touch .btn-close-modal {
    min-width: 44px;
    min-height: 44px;
}

body.touch .game-modal .modal-content-box {
    max-height: calc(100% - 20px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Celular deitado: pouco espaço para cima e para baixo */
@media (max-height: 520px) {
    body.touch .hud-minimap {
        display: none;
    }
    body.touch .hud-quick-buttons {
        top: 8px;
        bottom: auto;
        gap: 4px;
    }
    body.touch .btn-hud-action {
        padding: 5px 8px;
        border-width: 2px;
    }
    body.touch .btn-hud-action .ico {
        font-size: 18px;
    }
    body.touch .hud-top-left {
        top: 8px;
        left: calc(8px + env(safe-area-inset-left, 0px));
    }
    body.touch .hud-top-right {
        top: 8px;
        right: calc(8px + env(safe-area-inset-right, 0px));
    }
    body.touch .hud-tracker {
        left: calc(8px + env(safe-area-inset-left, 0px));
    }
    body.touch #mobile-controls {
        left: calc(12px + env(safe-area-inset-left, 0px));
        right: calc(12px + env(safe-area-inset-right, 0px));
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }
    body.touch .stick {
        width: 112px;
        height: 112px;
    }
    body.touch .stick-knob {
        width: 50px;
        height: 50px;
        margin: -25px 0 0 -25px;
    }
    body.touch .btn-virtual-action {
        width: 78px;
        height: 78px;
        font-size: 32px;
    }
    body.touch #interaction-prompt {
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        max-width: calc(100vw - 250px);
        font-size: 13.5px;
        padding: 6px 14px;
    }
    body.touch #toast-container {
        top: 52px;
    }
    body.touch .title-card {
        max-height: calc(100% - 12px);
        overflow-y: auto;
        padding-top: 18px;
    }
    body.touch .title-mascot {
        display: none;
    }
    body.touch .title-logo {
        font-size: 34px;
        margin-bottom: 0;
    }
    body.touch .title-subtitle {
        margin-bottom: 8px;
        font-size: 13px;
    }
    body.touch .title-menu-buttons {
        gap: 7px;
    }
    body.touch .btn-title {
        padding: 9px 16px;
        font-size: 15px;
    }
    body.touch .btn-title.btn-big {
        padding: 10px 18px;
        font-size: 17px;
    }
}

/* Celular em pé: pede para virar */
#rotate-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: linear-gradient(180deg, #ffd6e8, #ffe9c9);
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

.rotate-card p {
    font-size: 22px;
    font-weight: 600;
    color: var(--ink);
    max-width: 280px;
    margin: 14px auto 0;
}

.rotate-phone {
    font-size: 84px;
    line-height: 1;
    animation: rotatePhone 1.8s ease-in-out infinite;
}

@keyframes rotatePhone {
    0%, 25% { transform: rotate(0deg); }
    60%, 100% { transform: rotate(-90deg); }
}

@media (orientation: portrait) and (max-width: 600px) {
    body.touch #rotate-overlay {
        display: flex;
    }
}

/* Tablet em pé: os botões do alto descem para baixo do painel da criança */
@media (orientation: portrait) and (min-width: 601px) and (max-width: 900px) {
    body.touch .hud-quick-buttons {
        top: 112px;
        bottom: auto;
    }
    body.touch .hud-tracker {
        top: 168px;
    }
}

/* O minijogo cabe inteiro na tela, também num celular deitado (a altura manda) */
.modal-content-box.box-minigame {
    width: min(100%, 700px, calc((100vh - 42px) * 1.5238 + 30px));
    width: min(100%, 700px, calc((100dvh - 42px) * 1.5238 + 30px));
}

body.touch .game-modal .modal-content-box.box-minigame {
    max-height: none;
    overflow: hidden;
}

@media (max-height: 520px) {
    .modal-content-box.box-minigame {
        padding: 6px;
        border-radius: 18px;
    }
    .minigame-canvas {
        border-radius: 12px;
    }
}

/* Diálogos na tela de toque: o retrato continua aparecendo por cima da caixa, a caixa
   nunca passa da tela e, quando as escolhas são muitas, elas rolam dentro da caixa */
body.touch .game-modal.dialog-layer {
    padding-top: 58px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}

body.touch .game-modal .modal-content-box.dialog-content {
    max-height: 100%;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

body.touch .dialog-content .dialog-box {
    flex: 0 0 auto;
}

body.touch .dialog-content .dialog-text {
    max-height: 30vh;
    max-height: 30dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.touch .dialog-content .dialog-options {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 5px;
}

@media (max-height: 520px) {
    body.touch .game-modal.dialog-layer {
        padding-top: 46px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }
    body.touch .game-modal .modal-content-box.dialog-content {
        padding: 12px 14px 10px;
    }
    body.touch .dialog-content .dialog-box {
        margin-bottom: 8px;
        gap: 10px;
    }
    body.touch .dialog-content .dialog-text {
        max-height: 26vh;
        max-height: 26dvh;
        font-size: 14.5px;
        padding: 8px 12px;
    }
    body.touch .dialog-content .dialog-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    body.touch .btn-dialog-choice {
        min-height: 42px;
        font-size: 14.5px;
        padding: 7px 12px;
    }
}
