/* ==========================================================================
   DISEÑO DE JUEGO: LA TIENDITA DE JUGUETES
   Estética EdTech Premium, Billetes de Pesos Argentinos y Monedas Metálicas
   ========================================================================== */

:root {
    --font-primary: 'Fredoka', sans-serif;
    --color-wall: #FFF8E7; /* Fondo beige cálido de pared */
    --color-wood: #D7A15C; /* Madera clara */
    --color-wood-dark: #A0522D; /* Madera oscura */
    --color-border: #4A2711;
    
    /* Variables de Billetes (Colores aproximados a pesos reales) */
    --color-bill-100: #ec407a;
    --color-bill-50: #29b6f6;
    --color-bill-20: #ff7043;
    --color-bill-10: #a1887f;
}

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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-primary);
    background: var(--color-wall);
}

/* ==========================================================================
   PAISAJE DE FONDO
   ========================================================================== */
.shop-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: linear-gradient(180deg, #FFE8C5 0%, #FFF8E7 100%);
    pointer-events: none;
}

/* Luz de estante */
.shelf-light {
    position: absolute;
    top: 0;
    left: 5%;
    width: 90%;
    height: 250px;
    background: radial-gradient(ellipse at top, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0) 80%);
}

/* Contenedor del juego */
.game-container {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 15px 20px;
}

/* ==========================================================================
   ENCABEZADO
   ========================================================================== */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    flex-shrink: 0;
    border-bottom: 3px solid var(--color-wood);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-back {
    background: #ffffff;
    border: 3px solid var(--color-border);
    border-radius: 15px;
    padding: 8px 16px;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-border);
    text-decoration: none;
    box-shadow: 0 4px 0 var(--color-border);
    transition: all 0.15s ease;
}
.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--color-border);
}
.btn-back:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--color-border);
}

.game-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-border);
    text-shadow: 2px 2px 0px #ffffff;
}

/* Indicador de Desafío y Estrellas */
.level-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 3px solid var(--color-border);
    padding: 6px 15px;
    border-radius: 20px;
    box-shadow: 0 4px 0 var(--color-border);
}

.stars-label {
    font-weight: 700;
    color: var(--color-border);
    font-size: 0.95rem;
}

.stars-container {
    display: flex;
    gap: 5px;
    font-size: 1.2rem;
}

.level-text {
    font-weight: 700;
    color: #f39c12;
    border-left: 2px solid #ddd;
    padding-left: 10px;
    font-size: 0.95rem;
}

/* Controles de sonido / fullscreen */
.controls {
    display: flex;
    gap: 10px;
}

.btn-control {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid var(--color-border);
    background: #ffffff;
    box-shadow: 0 4px 0 var(--color-border);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn-control .icon { font-size: 1.3rem; }
.btn-control:hover { transform: scale(1.08) translateY(-2px); }
.btn-control:active { transform: scale(0.95) translateY(2px); }
.btn-control:not(.active) .icon { filter: grayscale(100%) opacity(0.4); }

/* ==========================================================================
   TABLERO PRINCIPAL
   ========================================================================== */
.game-board {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
    flex-grow: 1;
    height: calc(100% - 75px);
}

/* ==========================================================================
   COLUMNA IZQUIERDA: VENDEDOR Y JUGUETE
   ========================================================================== */
.shopkeeper-section {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.5);
    border: 3px solid var(--color-border);
    border-radius: 30px;
    padding: 20px;
    box-shadow: 0 8px 0 rgba(74, 39, 17, 0.1);
    position: relative;
}

/* Burbuja de diálogo */
.dialogue-bubble {
    background: #ffffff;
    border: 3px solid var(--color-border);
    border-radius: 20px;
    padding: 15px;
    position: relative;
    margin-bottom: 20px;
    box-shadow: 0 6px 0 rgba(74, 39, 17, 0.15);
    animation: bubbleFloat 3s ease-in-out infinite alternate;
}
.dialogue-bubble::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 80px;
    border-width: 15px 15px 0;
    border-style: solid;
    border-color: #ffffff transparent;
    display: block;
    width: 0;
    z-index: 10;
}
.dialogue-bubble::before {
    content: '';
    position: absolute;
    bottom: -19px;
    left: 78px;
    border-width: 17px 17px 0;
    border-style: solid;
    border-color: var(--color-border) transparent;
    display: block;
    width: 0;
    z-index: 9;
}

.dialogue-bubble p {
    font-size: 1.15rem;
    color: var(--color-border);
    font-weight: 500;
    line-height: 1.4;
}
.dialogue-bubble strong {
    font-size: 1.35rem;
    color: #e67e22;
}

@keyframes bubbleFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

/* Personaje */
.character-visual {
    width: 140px;
    height: 140px;
    align-self: flex-start;
    margin-left: 30px;
    position: relative;
    margin-bottom: 10px;
}
.fox-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

/* Estante de exhibición */
.shelf-display {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
}

.wood-shelf {
    width: 100%;
    height: 16px;
    background: linear-gradient(180deg, var(--color-wood) 0%, var(--color-wood-dark) 100%);
    border: 3px solid var(--color-border);
    border-radius: 10px;
    position: relative;
    display: flex;
    justify-content: center;
}

.toy-card {
    position: absolute;
    bottom: 13px;
    width: 160px;
    height: 160px;
    background: #ffffff;
    border: 4px solid var(--color-border);
    border-radius: 25px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08), 0 8px 0 var(--color-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    animation: toyBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toyBounce {
    0% { transform: scale(0.6) translateY(50px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.toy-image-container {
    width: 100px;
    height: 95px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.toy-svg-item {
    width: 100%;
    height: 100%;
}

.price-tag {
    background: #ff7675;
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 750;
    padding: 4px 18px;
    border-radius: 15px;
    border: 3px solid var(--color-border);
    box-shadow: 0 3px 0 var(--color-border);
    text-shadow: 0 2px 2px rgba(0,0,0,0.1);
}

/* ==========================================================================
   COLUMNA DERECHA: MOSTRADOR Y CARTERA
   ========================================================================== */
.checkout-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
}

/* Mostrador */
.counter-table {
    flex-grow: 1;
    background: #fff;
    border: 4px solid var(--color-border);
    border-radius: 35px;
    box-shadow: inset 0 8px 16px rgba(0,0,0,0.03), 0 8px 0 rgba(74, 39, 17, 0.1);
    display: flex;
    flex-direction: column;
    padding: 15px;
    position: relative;
    overflow: hidden;
}

.counter-table::before {
    /* Textura de mantel de mostrador */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(0,0,0,0.015) 20%, transparent 20%),
                      radial-gradient(rgba(0,0,0,0.015) 20%, transparent 20%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    pointer-events: none;
}

.counter-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: #8c7b72;
    text-align: center;
    border-bottom: 2px dashed #ddd;
    padding-bottom: 8px;
    margin-bottom: 10px;
    z-index: 2;
}

.deposited-money-area {
    flex-grow: 1;
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.counter-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 3px solid var(--color-wood);
    padding-top: 12px;
    margin-top: 10px;
    z-index: 10;
}

.total-counter {
    font-size: 1.25rem;
    color: var(--color-border);
    font-weight: 600;
}
.total-counter strong {
    font-size: 1.7rem;
    color: #27AE60;
    background: #eef9f0;
    border: 2px solid #27AE60;
    border-radius: 12px;
    padding: 2px 12px;
    margin-left: 5px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-clear {
    background: #ff7675;
    color: #ffffff;
    border: 3px solid var(--color-border);
    border-radius: 18px;
    padding: 10px 18px;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--color-border);
    transition: all 0.1s ease;
}
.btn-clear:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--color-border); }
.btn-clear:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--color-border); }

.btn-submit {
    background: linear-gradient(185deg, #2ecc71 0%, #27ae60 100%);
    color: #ffffff;
    border: 3px solid var(--color-border);
    border-radius: 18px;
    padding: 10px 24px;
    font-family: var(--font-primary);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--color-border);
    transition: all 0.1s ease;
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--color-border); }
.btn-submit:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--color-border); }

/* ==========================================================================
   CAJÓN DE MONTO (WALLET DRAWER)
   ========================================================================== */
.money-drawer {
    background: #ede0d4;
    border: 4px solid var(--color-border);
    border-radius: 30px;
    padding: 15px;
    box-shadow: 0 6px 0 rgba(74, 39, 17, 0.15);
    height: 185px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.drawer-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #6f4e37;
    margin-bottom: 5px;
    text-align: center;
}

.drawer-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
    justify-content: center;
}

.drawer-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
}

.money-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    outline: none;
}

/* ==========================================================================
   ESTILOS DE BILLETES (ARGENTINA CSS)
   ========================================================================== */
.money-button .bill-face, .deposited-bill .bill-face {
    width: 105px;
    height: 52px;
    border-radius: 6px;
    border: 3px solid var(--color-border);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1), 0 4px 0 var(--color-border);
    color: #ffffff;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.035) 0px, rgba(255,255,255,0.035) 1px, transparent 1px, transparent 8px),
                      repeating-linear-gradient(-45deg, rgba(255,255,255,0.035) 0px, rgba(255,255,255,0.035) 1px, transparent 1px, transparent 8px) !important;
    outline: 2px dashed rgba(255, 255, 255, 0.35);
    outline-offset: -5px;
}

.bill-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    align-items: flex-start;
}

.bill-number {
    font-size: 1.15rem;
    line-height: 1;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.3);
}

.bill-number-bottom {
    position: absolute;
    bottom: 3px;
    right: 5px;
    font-size: 0.85rem !important;
    opacity: 0.85;
    font-weight: 700;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.3);
}

.bill-sub {
    font-size: 0.45rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.15);
    padding: 1px 3px;
    border-radius: 3px;
    margin-top: 1px;
    white-space: nowrap;
    max-width: 65px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bill-portrait {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
    pointer-events: none;
}

.portrait-svg {
    width: 100%;
    height: 100%;
}

.money-button:hover .bill-face {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.15), 0 6px 0 var(--color-border);
}

.money-button:active .bill-face {
    transform: scale(0.96) translateY(2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 2px 0 var(--color-border);
}

/* Diseños específicos de billetes */
.bill-100 .bill-face { background: linear-gradient(135deg, #f06292 0%, var(--color-bill-100) 100%); }
.bill-50 .bill-face { background: linear-gradient(135deg, #4fc3f7 0%, var(--color-bill-50) 100%); }
.bill-20 .bill-face { background: linear-gradient(135deg, #ff8a65 0%, var(--color-bill-20) 100%); }
.bill-10 .bill-face { background: linear-gradient(135deg, #bcaaa4 0%, var(--color-bill-10) 100%); }

/* ==========================================================================
   ESTILOS DE MONEDAS
   ========================================================================== */
.money-button .coin-face, .deposited-coin .coin-face {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid var(--color-border);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-border);
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.12), 0 4px 0 var(--color-border);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.money-button:hover .coin-face {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.15), 0 6px 0 var(--color-border);
}

.money-button:active .coin-face {
    transform: scale(0.96) translateY(2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 2px 0 var(--color-border);
}

/* Moneda de 5 (Color Dorado) */
.coin-5 .coin-face {
    background: radial-gradient(circle at 35% 35%, #fff176 0%, #fbc02d 70%, #f9a825 100%);
    color: #4a2711;
}

/* Moneda de 2 (Bi-metálica: Centro plateado, borde dorado) */
.coin-2 .coin-face {
    background: radial-gradient(circle at 35% 35%, #ffe082 0%, #ffb300 70%);
    box-shadow: inset 0 0 0 6px #e0e0e0, 0 4px 0 var(--color-border);
    color: #4a2711;
}

/* Moneda de 1 (Cobre / Bronce) */
.coin-1 .coin-face {
    background: radial-gradient(circle at 35% 35%, #ffab91 0%, #d84315 70%, #c62828 100%);
    color: #ffffff;
}

/* ==========================================================================
   MONEY EN EL MOSTRADOR (Posicionado Absoluto con Rotaciones)
   ========================================================================== */
.deposited-bill {
    position: absolute;
    width: 105px;
    height: 52px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s ease;
    will-change: transform, left, top;
}
.deposited-bill .bill-face {
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.deposited-coin {
    position: absolute;
    width: 48px;
    height: 48px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s ease;
    will-change: transform, left, top;
}
.deposited-coin .coin-face {
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Al pasar el ratón por encima del dinero depositado para poder sacarlo */
.deposited-bill:hover, .deposited-coin:hover {
    transform: scale(1.15) rotate(0deg) !important;
    z-index: 50;
}

/* ==========================================================================
   EFECTOS Y ANIMACIONES DE COBRO
   ========================================================================== */

/* Acierto: Wiggle en el mostrador */
@keyframes counterSuccess {
    0% { transform: scale(1); }
    25% { transform: scale(1.02) rotate(-1deg); }
    50% { transform: scale(1.02) rotate(1deg); }
    100% { transform: scale(1); }
}
.animate-success {
    animation: counterSuccess 0.4s ease-in-out;
    border-color: #27AE60 !important;
}

/* Error: Shake de la mesa */
@keyframes counterError {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}
.animate-error {
    animation: counterError 0.4s ease-in-out;
    border-color: #ff7675 !important;
}

/* Animación cuando se limpia o vuela el dinero */
.money-flying {
    transition: left 0.4s cubic-bezier(0.25, 1, 0.5, 1), top 0.4s cubic-bezier(0.25, 1, 0.5, 1), transform 0.4s ease !important;
    pointer-events: none;
}

.money-fade-out {
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53), opacity 0.4s ease !important;
    transform: scale(0.1) translateY(-100px) !important;
    opacity: 0;
}

/* ==========================================================================
   PANTALLA DE CELEBRACIÓN (DIPLOMA)
   ========================================================================== */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.celebration-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

#confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1001;
}

.celebration-content {
    background: #ffffff;
    border-radius: 40px;
    padding: 40px 50px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border: 8px solid #FFD700;
    max-width: 90%;
    width: 480px;
    transform: scale(0.7) translateY(50px);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1002;
    position: relative;
}

.celebration-overlay.show .celebration-content {
    transform: scale(1) translateY(0);
}

.diploma-icon {
    font-size: 4.5rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
    animation: prizeFloat 2s ease-in-out infinite alternate;
}

@keyframes prizeFloat {
    0% { transform: translateY(0) rotate(-5deg); }
    100% { transform: translateY(-10px) rotate(5deg); }
}

.celebration-title {
    font-size: 2.3rem;
    color: var(--color-wood-dark);
    margin-bottom: 8px;
    text-shadow: 2px 2px 0px #fff, 4px 4px 0px rgba(0,0,0,0.05);
}

.celebration-subtitle {
    font-size: 1.25rem;
    color: #4a4e69;
    margin-bottom: 25px;
}

.score-summary {
    background: #fff8eb;
    border: 2px dashed var(--color-wood);
    border-radius: 20px;
    padding: 15px;
    margin-bottom: 30px;
}
.score-summary p {
    font-size: 1.1rem;
    color: var(--color-border);
    font-weight: 500;
    margin-bottom: 10px;
}

.final-stars {
    font-size: 1.8rem;
    letter-spacing: 5px;
}

/* Botón jugar otra vez */
.btn-replay {
    background: linear-gradient(135deg, #FFED9E 0%, #FFA800 100%);
    border: 4px solid #ffffff;
    border-radius: 25px;
    padding: 15px 35px;
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(255, 168, 0, 0.4);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulseReplay 2s infinite;
}

.btn-replay:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 15px 25px rgba(255, 168, 0, 0.5);
}

.btn-replay:active {
    transform: scale(0.96) translateY(1px);
}

@keyframes pulseReplay {
    0% { box-shadow: 0 10px 20px rgba(255, 168, 0, 0.4); }
    50% { box-shadow: 0 10px 30px rgba(255, 168, 0, 0.7); }
    100% { box-shadow: 0 10px 20px rgba(255, 168, 0, 0.4); }
}

/* ==========================================================================
   ADAPTATIVIDAD (MEDIA QUERIES)
   ========================================================================== */

/* Pantallas Medianas (Móviles grandes y tablets en vertical) */
@media (max-width: 900px) {
    .game-board {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        gap: 15px;
        height: auto;
        overflow-y: auto;
    }
    
    .shopkeeper-section {
        flex-direction: row;
        align-items: center;
        padding: 12px;
        gap: 15px;
    }
    
    .dialogue-bubble {
        margin-bottom: 0;
        flex-grow: 1;
    }
    .dialogue-bubble::after {
        bottom: auto;
        left: -15px;
        top: 25px;
        border-width: 15px 15px 15px 0;
        border-color: transparent #ffffff;
    }
    .dialogue-bubble::before {
        bottom: auto;
        left: -19px;
        top: 23px;
        border-width: 17px 17px 17px 0;
        border-color: transparent var(--color-border);
    }
    
    .character-visual {
        margin-left: 0;
        width: 85px;
        height: 85px;
        margin-bottom: 0;
    }
    
    .shelf-display {
        width: 130px;
        flex-grow: 0;
        padding: 0;
    }
    
    .toy-card {
        width: 110px;
        height: 110px;
        bottom: 12px;
        padding: 6px;
    }
    
    .toy-image-container {
        width: 65px;
        height: 60px;
    }
    
    .price-tag {
        font-size: 0.95rem;
        padding: 2px 10px;
    }
    
    .money-drawer {
        height: 140px;
        padding: 8px;
    }
    
    .money-button .bill-face, .deposited-bill {
        width: 85px;
        height: 42px;
        border-width: 2px;
    }
    
    .bill-number { font-size: 0.85rem; }
    .bill-title, .bill-sub { display: none; }
    .bill-portrait {
        width: 24px;
        height: 24px;
        right: 18px;
        border-width: 1px;
    }
    .bill-number-bottom {
        font-size: 0.65rem !important;
        bottom: 2px;
        right: 4px;
    }
    
    .money-button .coin-face, .deposited-coin {
        width: 38px;
        height: 38px;
        border-width: 2px;
        font-size: 1.1rem;
    }
}

@media (max-width: 580px) {
    .game-header {
        flex-direction: column;
        height: auto;
        gap: 10px;
        align-items: center;
    }
    
    .game-title {
        font-size: 1.5rem;
    }
    
    .btn-back {
        padding: 5px 10px;
        font-size: 0.85rem;
    }
    
    .level-progress {
        padding: 4px 10px;
        font-size: 0.8rem;
    }
    
    .stars-container { font-size: 1rem; }
    .level-text { font-size: 0.8rem; }
    
    .shopkeeper-section {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .dialogue-bubble {
        width: 100%;
        order: 1;
    }
    .dialogue-bubble::after, .dialogue-bubble::before { display: none; }
    
    .character-visual {
        order: 2;
        width: 70px;
        height: 70px;
    }
    .shelf-display {
        order: 3;
        width: 100px;
    }
    .toy-card {
        width: 90px;
        height: 90px;
    }
    .toy-image-container {
        width: 55px;
        height: 50px;
    }
    
    .counter-footer {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .action-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .btn-clear, .btn-submit {
        padding: 8px 15px;
        font-size: 0.95rem;
    }
}
