/* === CSS VARIABLES === */
:root {
    /* Main palette */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #22c55e;
    --secondary-dark: #16a34a;
    --accent: #f59e0b;

    /* Backgrounds */
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-light: #334155;

    /* Status colors */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Text */
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #64748b;

    /* UI */
    --gold: #fbbf24;
    --white: #ffffff;
    --black: #000000;

    /* Dimensions */
    --game-width: 400px;
    --game-height: 700px;
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: manipulation;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* === GAME CONTAINER === */
#game-container {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
    /* Safe area support for iOS */
    padding-top: env(safe-area-inset-top, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

/* Prevent pinch zoom on all elements */
#game-container,
#game-container * {
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

/* Optional: bordered view on larger screens */
@media (min-width: 600px) and (min-height: 800px) {
    body {
        padding: 20px;
    }
    #game-container {
        max-width: 480px;
        max-height: 850px;
        border-radius: 20px;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }
}

/* === VIEWS === */
.view {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* === START VIEW === */
#start-view {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.3) 0%, var(--bg-dark) 30%);
    align-items: center;
    padding: 20px;
}

.start-header {
    text-align: center;
    margin-top: 40px;
}

.start-title {
    font-size: 42px;
    color: var(--white);
    font-weight: bold;
}

.start-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin-top: 5px;
}

.egg-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.egg-sprite {
    width: 120px;
    height: 120px;
    animation: egg-bob 2s ease-in-out infinite, egg-wiggle 1s ease-in-out infinite;
}

@keyframes egg-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes egg-wiggle {
    0%, 100% { rotate: -5deg; }
    50% { rotate: 5deg; }
}

.start-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-light);
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    max-width: 320px;
    text-align: center;
}

.card-label {
    color: var(--text-light);
    font-size: 16px;
    margin-bottom: 15px;
}

.welcome-text {
    color: var(--text-light);
    font-size: 20px;
    margin-bottom: 10px;
}

.pet-waiting {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

#name-input {
    width: 100%;
    padding: 14px 20px;
    font-family: inherit;
    font-size: 18px;
    text-align: center;
    background: var(--bg-light);
    border: 2px solid #475569;
    border-radius: 12px;
    color: var(--text-light);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 20px;
}

#name-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

#name-input::placeholder {
    color: var(--text-dark);
}

/* === BUTTONS === */
.btn {
    width: 100%;
    padding: 14px 24px;
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-icon {
    width: 24px;
    height: 24px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-muted);
    margin-top: 10px;
}

.btn-small {
    padding: 8px 12px;
    font-size: 12px;
    min-width: auto;
}

.btn-secondary:hover {
    background: var(--danger);
    color: var(--white);
}

/* === GAME VIEW === */
#game-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-card);
    min-height: 80px;
}

.header-left {
    display: flex;
    flex-direction: column;
}

.pet-name {
    font-size: 20px;
    color: var(--text-light);
    font-weight: bold;
}

.pet-stage {
    font-size: 12px;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.streak {
    font-size: 12px;
    color: var(--gold);
}

.settings-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.settings-btn:hover {
    opacity: 1;
}

.settings-btn img {
    width: 24px;
    height: 24px;
    filter: invert(1);
}

.gold-display {
    background: rgba(251, 191, 36, 0.2);
    color: var(--gold);
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 16px;
}

.gold-display::before {
    content: '💰 ';
}

/* Pet Area */
.pet-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.pet-container {
    width: 180px;
    height: 180px;
    background: var(--bg-card);
    border: 3px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    animation: pet-idle 3s ease-in-out infinite;
}

.pet-container:hover {
    border-color: var(--accent);
}

.pet-container:active {
    transform: scale(0.95);
}

.pet-container.night {
    background: var(--bg-card);
}

@keyframes pet-idle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.pet-sprite {
    width: 100px;
    height: 100px;
    transition: transform 0.3s;
}

.pet-container:active .pet-sprite {
    animation: pet-wiggle 0.3s ease-in-out;
}

@keyframes pet-wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.poop-indicator {
    position: absolute;
    bottom: 10px;
    right: -30px;
    font-size: 24px;
}

.interaction-hint {
    font-size: 11px;
    color: var(--text-dark);
    margin-top: 15px;
    opacity: 0.7;
}

.reaction-text {
    position: absolute;
    top: 30px;
    font-size: 20px;
    color: var(--text-light);
    opacity: 0;
    transition: all 0.5s;
}

.reaction-text.show {
    opacity: 1;
    animation: reaction-float 1.5s ease-out forwards;
}

@keyframes reaction-float {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-30px); }
}

/* Night Overlay - disabled for visibility */
.night-overlay {
    display: none !important;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
    padding: 15px 20px;
    background: var(--bg-card);
    border-radius: 12px;
    margin: 0 15px;
}

/* Weight display */
.stat-weight {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-light);
}

.weight-status {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--success);
    color: var(--white);
    margin-left: auto;
}

.weight-status.overweight {
    background: var(--warning);
}

.weight-status.underweight {
    background: var(--danger);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-row .stat-bar {
    flex: 1;
    height: 10px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 90px;
}

.stat-icon {
    width: 14px;
    height: 14px;
    filter: invert(0.6);
}

.stat-bar {
    height: 8px;
    width: 100%;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background: var(--success);
    border-radius: 4px;
    transition: width 0.5s ease, background-color 0.3s;
    width: 50%;
}

.stat-fill.warning {
    background: var(--warning);
}

.stat-fill.danger {
    background: var(--danger);
    animation: stat-pulse 1s ease-in-out infinite;
}

@keyframes stat-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.stat-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    text-align: right;
    min-width: 35px;
}

.action-btn {
    flex: 0 0 auto;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px;
    background: var(--bg-light);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.action-btn:hover {
    background: var(--primary);
}

.action-btn:hover span {
    color: var(--white);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn img {
    width: 28px;
    height: 28px;
    filter: invert(1);
}

.action-btn span {
    font-size: 11px;
    color: var(--text-muted);
    transition: color 0.2s;
}

/* Bottom Navigation */
.bottom-nav {
    display: flex;
    background: var(--bg-card);
    border-top: 1px solid var(--bg-light);
    padding: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
    margin-top: auto;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    overflow-x: auto;
    gap: 5px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.bottom-nav::-webkit-scrollbar {
    display: none;
}

.nav-divider {
    width: 1px;
    background: var(--bg-light);
    margin: 5px 5px;
    flex-shrink: 0;
}

.nav-btn {
    flex: 0 0 auto;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.nav-btn img {
    width: 24px;
    height: 24px;
    filter: invert(0.6);
    transition: filter 0.2s;
}

.nav-btn span {
    font-size: 11px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.nav-btn.active img {
    filter: invert(0.5) sepia(1) saturate(5) hue-rotate(210deg);
}

.nav-btn.active span {
    color: var(--primary);
}

.nav-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

/* === MODALS === */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: modal-fade-in 0.2s ease;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    width: 90%;
    max-width: 340px;
    max-height: 90%;
    overflow-y: auto;
    animation: modal-slide-up 0.3s ease;
}

.modal-large {
    max-height: 95%;
    width: 95%;
}

@media (min-width: 768px) {
    .modal-content {
        max-width: 80%;
    }
}

@keyframes modal-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 10px;
}

.modal-header h2 {
    font-size: 20px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-icon {
    width: 24px;
    height: 24px;
    filter: invert(1);
}

.modal-gold {
    font-size: 14px;
    padding: 6px 12px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--text-light);
}

.modal-back {
    margin-top: 15px;
}

/* === SHOP === */
.shop-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.shop-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 5px;
    background: var(--bg-card);
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-tab img {
    width: 16px;
    height: 16px;
    filter: invert(0.6);
}

.shop-tab.active {
    background: var(--primary);
    color: var(--white);
}

.shop-tab.active img {
    filter: invert(1);
}

.shop-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 350px;
    overflow-y: auto;
}

.shop-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--bg-light);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-item:hover {
    background: var(--bg-light);
}

.shop-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.shop-item.locked:hover {
    background: var(--bg-card);
}

.shop-item-icon {
    width: 40px;
    height: 40px;
    max-width: 45px;
    max-height: 45px;
    object-fit: contain;
}

.shop-item-emoji {
    font-size: 32px;
    width: 45px;
    max-width: 45px;
    max-height: 45px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.shop-item-emoji svg {
    width: 100%;
    height: 100%;
    max-width: 45px;
    max-height: 45px;
}

.shop-item.owned {
    opacity: 0.6;
    border-color: var(--success);
}

.shop-item.owned .shop-item-price {
    color: var(--success);
    background: rgba(34, 197, 94, 0.2);
}

.shop-item-info {
    flex: 1;
}

.shop-item-name {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-light);
}

.shop-item-desc {
    font-size: 11px;
    color: var(--text-dark);
}

.shop-item-price {
    font-size: 14px;
    font-weight: bold;
    padding: 5px 12px;
    background: var(--bg-light);
    border-radius: 15px;
}

.shop-item-price.affordable {
    color: var(--success);
}

.shop-item-price.expensive {
    color: var(--danger);
}

/* === MINIGAMES === */
.game-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}

.game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    background: var(--bg-card);
    border: 2px solid var(--bg-light);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.game-card:hover {
    background: var(--bg-light);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.game-card:active {
    transform: scale(0.98);
}

.game-emoji {
    font-size: 36px;
    margin-bottom: 5px;
}

.game-icon {
    width: 40px;
    height: 40px;
    filter: invert(1);
}

.game-info {
    flex: 1;
}

.game-info h3 {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 3px;
    font-weight: bold;
}

.game-info p {
    font-size: 10px;
    color: var(--text-dark);
}

.game-reward {
    font-size: 12px;
    font-weight: bold;
    color: var(--gold);
    background: rgba(251, 191, 36, 0.15);
    padding: 4px 10px;
    border-radius: 10px;
}

/* Minigame common */
.minigame {
    text-align: center;
    padding: 10px 0;
}

.game-progress {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.game-score {
    font-size: 20px;
    font-weight: bold;
    color: var(--gold);
    margin-bottom: 20px;
}

/* Guess Game */
.guess-question {
    font-size: 20px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.guess-pet {
    font-size: 48px;
    margin-bottom: 30px;
}

.guess-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

.guess-btn {
    padding: 20px 40px;
    font-size: 18px;
    font-weight: bold;
    background: var(--bg-card);
    border: none;
    border-radius: 12px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.guess-btn:hover {
    background: var(--primary);
}

.guess-result {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
}

.guess-result.correct {
    color: var(--success);
}

.guess-result.wrong {
    color: var(--danger);
}

.guess-answer {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Catch Game */
.catch-area {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.catch-positions {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.catch-position {
    width: 50px;
    height: 50px;
    background: var(--bg-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.catch-position:hover {
    background: var(--primary);
}

.catch-position .star {
    font-size: 32px;
}

.catch-baskets {
    display: flex;
    justify-content: space-around;
}

.catch-basket {
    font-size: 36px;
    opacity: 0.3;
}

.catch-basket.active {
    opacity: 1;
}

.catch-btn {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    background: var(--success);
    border: none;
    border-radius: 12px;
    color: var(--white);
    cursor: pointer;
    transition: all 0.2s;
}

.catch-btn:hover {
    background: var(--secondary-dark);
}

.catch-hint {
    font-size: 12px;
    color: var(--text-dark);
    margin-top: 15px;
}

/* Memory Game */
.memory-status {
    font-size: 16px;
    color: var(--gold);
    margin-bottom: 15px;
}

.memory-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    max-width: 220px;
    margin: 0 auto 20px;
}

.memory-btn {
    width: 90px;
    height: 90px;
    border: 3px solid var(--bg-light);
    border-radius: 12px;
    font-size: 40px;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.7;
}

.memory-btn:hover {
    opacity: 1;
}

.memory-btn.highlight {
    opacity: 1;
    border-color: var(--white);
}

.memory-btn.red { background: var(--danger); }
.memory-btn.blue { background: var(--info); }
.memory-btn.yellow { background: var(--gold); }
.memory-btn.green { background: var(--success); }

.memory-btn.pressed {
    animation: memory-press 0.2s ease-out;
}

@keyframes memory-press {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.9); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.memory-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.memory-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-light);
}

.memory-dot.filled {
    background: var(--success);
}

/* Game Timer */
.game-timer {
    font-size: 18px;
    color: var(--warning);
    font-weight: bold;
    margin-bottom: 15px;
}

.game-timer.urgent {
    color: var(--danger);
    animation: timer-pulse 0.5s ease-in-out infinite;
}

@keyframes timer-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Math Game */
.math-question {
    font-size: 36px;
    color: var(--text-light);
    font-weight: bold;
    margin: 20px 0;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 12px;
}

.math-answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-width: 280px;
    margin: 0 auto;
}

.math-btn {
    padding: 15px 20px;
    font-size: 20px;
    font-weight: bold;
    background: var(--bg-card);
    border: 2px solid var(--bg-light);
    border-radius: 12px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.math-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.math-btn.correct {
    background: var(--success);
    border-color: var(--success);
}

.math-btn.wrong {
    background: var(--danger);
    border-color: var(--danger);
}

/* RPS Game */
.rps-choices {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.rps-choice {
    width: 80px;
    height: 80px;
    font-size: 40px;
    background: var(--bg-card);
    border: 3px solid var(--bg-light);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rps-choice:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

.rps-choice.selected {
    border-color: var(--gold);
    background: var(--bg-light);
}

.rps-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.rps-player, .rps-opponent {
    text-align: center;
}

.rps-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.rps-icon {
    font-size: 60px;
    display: block;
}

.rps-vs-text {
    font-size: 24px;
    color: var(--text-muted);
    font-weight: bold;
}

.rps-result {
    font-size: 24px;
    font-weight: bold;
    margin: 15px 0;
}

.rps-result.win { color: var(--success); }
.rps-result.lose { color: var(--danger); }
.rps-result.draw { color: var(--warning); }

/* Reaction Game */
.reaction-box {
    width: 200px;
    height: 200px;
    margin: 20px auto;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.1s;
}

.reaction-box.waiting {
    background: var(--danger);
    color: var(--white);
}

.reaction-box.ready {
    background: var(--success);
    color: var(--white);
    cursor: pointer;
}

.reaction-box.early {
    background: var(--warning);
    color: var(--bg-dark);
}

.reaction-box.result {
    background: var(--primary);
    color: var(--white);
}

.reaction-time {
    font-size: 48px;
    font-weight: bold;
    color: var(--gold);
    margin: 15px 0;
}

.reaction-rating {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.reaction-times {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.reaction-attempt {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-muted);
}

.reaction-attempt.done {
    background: var(--success);
    color: var(--white);
}

.reaction-attempt.current {
    background: var(--primary);
    color: var(--white);
}

/* Whack Game */
.whack-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 280px;
    margin: 0 auto;
}

.whack-cell {
    width: 80px;
    height: 80px;
    background: var(--bg-card);
    border: 3px solid var(--bg-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    cursor: pointer;
    transition: all 0.1s;
}

.whack-cell:hover {
    border-color: var(--primary);
}

.whack-cell.active {
    background: var(--primary);
    border-color: var(--accent);
    animation: whack-pop 0.2s ease-out;
}

.whack-cell.hit {
    background: var(--success);
    border-color: var(--success);
}

.whack-cell.missed {
    background: var(--danger);
    border-color: var(--danger);
}

@keyframes whack-pop {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.whack-instruction {
    font-size: 14px;
    color: var(--text-muted);
    margin: 15px 0;
}

/* Pairs Game */
.pairs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-width: 280px;
    margin: 0 auto;
}

.pairs-card {
    width: 60px;
    height: 70px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.pairs-card::before {
    content: '?';
    color: var(--white);
    font-size: 24px;
    font-weight: bold;
}

.pairs-card.flipped::before {
    display: none;
}

.pairs-card.flipped {
    background: var(--bg-card);
    border: 2px solid var(--bg-light);
}

.pairs-card.matched {
    background: var(--success);
    border: 2px solid var(--secondary-dark);
    pointer-events: none;
}

.pairs-card.matched::before {
    display: none;
}

.pairs-emoji {
    display: none;
}

.pairs-card.flipped .pairs-emoji,
.pairs-card.matched .pairs-emoji {
    display: block;
}

/* Pulse effect for critical stats */
.stat-fill.danger {
    animation: stat-pulse 1s ease-in-out infinite, stat-glow 1s ease-in-out infinite;
}

@keyframes stat-glow {
    0%, 100% { box-shadow: 0 0 5px var(--danger); }
    50% { box-shadow: 0 0 15px var(--danger), 0 0 20px var(--danger); }
}

/* Improved action button effects */
.action-btn:active {
    transform: scale(0.92);
}

.action-btn:hover .action-badge {
    transform: scale(1.2);
}

/* Pet glow effect when happy */
.pet-container.happy-glow {
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
}

/* Shimmer loading effect */
.loading-shimmer {
    background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-light) 50%, var(--bg-card) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Stat bar hover effect */
.stat-item:hover .stat-fill {
    filter: brightness(1.2);
}

/* Improved modal transitions */
.modal-content {
    transform-origin: center center;
}

/* Better scroll behavior */
.shop-items,
#status-content,
#inventory-items {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-dark);
}

/* Game card hover improvements */
.game-card {
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.game-card:hover::before {
    left: 100%;
}

/* Improved button states */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Info tooltip style */
.tooltip {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--bg-light);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-light);
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.tooltip.show {
    opacity: 1;
}

/* Notification dot */
.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: var(--danger);
    border-radius: 50%;
    animation: notification-pulse 2s infinite;
}

@keyframes notification-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

/* Level up animation */
.level-up-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    animation: level-up 1s ease-out forwards;
    pointer-events: none;
    z-index: 300;
}

@keyframes level-up {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
    100% { transform: translate(-50%, -100%) scale(1); opacity: 0; }
}

/* Game Result */
#game-result {
    text-align: center;
    padding: 30px 0;
}

.result-trophy {
    font-size: 64px;
    margin-bottom: 15px;
}

.result-score {
    font-size: 28px;
    font-weight: bold;
    color: var(--gold);
    margin-bottom: 10px;
}

.result-total {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.quit-btn {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.quit-btn:hover {
    color: var(--danger);
}

/* === STATUS === */
.status-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.status-tab {
    flex: 1;
    padding: 10px;
    background: var(--bg-card);
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.status-tab.active {
    background: var(--primary);
    color: var(--white);
}

#status-content {
    max-height: 400px;
    overflow-y: auto;
}

.status-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-card);
    border-left: 4px solid var(--success);
    border-radius: 8px;
    margin-bottom: 10px;
}

.status-card.warning {
    border-left-color: var(--warning);
}

.status-card-info {
    flex: 1;
}

.status-card-title {
    font-size: 13px;
    color: var(--text-muted);
}

.status-card-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-light);
}

.status-card-badge {
    font-size: 11px;
    color: var(--success);
}

.status-card-badge.warning {
    color: var(--warning);
}

.status-stat-row {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 8px;
}

.status-stat-label {
    font-size: 14px;
    color: var(--text-light);
    flex: 1;
}

.status-stat-value {
    font-size: 16px;
    font-weight: bold;
    color: var(--gold);
}

.status-stat-bar {
    flex: 1;
    margin-left: 15px;
}

.status-stat-percent {
    font-size: 12px;
    color: var(--text-muted);
    width: 50px;
    text-align: right;
}

/* Achievements list */
.achievement-progress {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
    position: relative;
}

.achievement-progress-fill {
    height: 26px;
    background: var(--primary);
    border-radius: 6px;
}

.achievement-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: var(--text-light);
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 8px;
}

.achievement-item.locked {
    opacity: 0.5;
}

.achievement-item-emoji {
    font-size: 24px;
}

.achievement-item-info {
    flex: 1;
}

.achievement-item-name {
    font-size: 13px;
    font-weight: bold;
    color: var(--text-light);
}

.achievement-item-desc {
    font-size: 10px;
    color: var(--text-dark);
}

.achievement-item-reward {
    font-size: 12px;
    color: var(--gold);
}

.achievement-item.locked .achievement-item-reward {
    color: var(--text-dark);
}

/* === INVENTORY === */
#inventory-items {
    max-height: 350px;
    overflow-y: auto;
}

.inventory-empty,
.quest-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.inventory-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.inventory-item:hover {
    background: var(--primary);
}

.inventory-item-icon {
    width: 36px;
    height: 36px;
    max-width: 45px;
    max-height: 45px;
    object-fit: contain;
}

.inventory-item-emoji {
    font-size: 28px;
    width: 40px;
    max-width: 45px;
    max-height: 45px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.inventory-item-emoji svg {
    width: 100%;
    height: 100%;
    max-width: 45px;
    max-height: 45px;
}

.inventory-item-info {
    flex: 1;
}

.inventory-item-name {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-light);
}

.inventory-item-effect {
    font-size: 11px;
    color: var(--text-dark);
}

.inventory-item-count {
    font-size: 14px;
    font-weight: bold;
    color: var(--gold);
}

/* Inventory Tabs */
.inventory-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.inventory-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 5px;
    background: var(--bg-card);
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.inventory-tab.active {
    background: var(--primary);
    color: var(--white);
}

.inventory-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* === SETTINGS === */
.settings-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.settings-option {
    padding: 15px 20px;
    background: var(--bg-light);
    border: none;
    border-radius: 10px;
    color: var(--text-light);
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-option:hover {
    background: var(--primary);
}

.settings-option.btn-primary {
    background: var(--primary);
    text-align: center;
}

.settings-hint {
    font-size: 10px;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 15px;
}

/* === DAILY REWARD === */
.daily-reward {
    text-align: center;
}

.daily-reward h2 {
    font-size: 20px;
    color: var(--gold);
    margin-bottom: 10px;
}

.streak-text {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.gift-emoji {
    font-size: 64px;
    margin-bottom: 15px;
    animation: gift-shake 0.5s ease-in-out infinite;
}

@keyframes gift-shake {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

.reward-amount {
    font-size: 28px;
    font-weight: bold;
    color: var(--gold);
    margin-bottom: 20px;
}

.streak-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.streak-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-light);
}

.streak-dot.complete {
    background: var(--gold);
}

.streak-dot.current {
    background: var(--gold);
    border: 2px solid var(--white);
}

/* === DEATH SCREEN === */
.death-screen {
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
}

.death-emoji {
    margin-bottom: 15px;
}

.death-sprite {
    width: 80px;
    height: 80px;
}

.death-screen h2 {
    font-size: 20px;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Death Stats */
.death-stats {
    background: var(--bg-dark);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.death-stats-title {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.death-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.death-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-card);
    border-radius: 8px;
    padding: 10px 8px;
    gap: 4px;
}

.death-stat-icon {
    font-size: 20px;
}

.death-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.death-stat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
}

/* Care Score Bar */
.death-care-score {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--bg-light);
}

.care-score-label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.care-score-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.care-score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--danger), var(--warning), var(--success));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.care-score-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    min-width: 35px;
}

/* === ACHIEVEMENT POPUP === */
.achievement-popup {
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 12px 20px;
    z-index: 200;
    animation: achievement-slide 0.5s ease forwards;
}

@keyframes achievement-slide {
    0% { top: -80px; opacity: 0; }
    100% { top: 50px; opacity: 1; }
}

.achievement-popup.hide {
    animation: achievement-hide 0.3s ease forwards;
}

@keyframes achievement-hide {
    0% { top: 50px; opacity: 1; }
    100% { top: -80px; opacity: 0; }
}

.achievement-emoji {
    font-size: 32px;
}

.achievement-info {
    display: flex;
    flex-direction: column;
}

.achievement-label {
    font-size: 10px;
    color: var(--gold);
}

.achievement-name {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-light);
}

.achievement-reward {
    font-size: 16px;
    font-weight: bold;
    color: var(--gold);
}

/* === TOAST === */
.toast-container {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 150;
    pointer-events: none;
}

.toast {
    background: var(--primary);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    animation: toast-show 0.2s ease;
}

@keyframes toast-show {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.toast.hide {
    animation: toast-hide 0.2s ease forwards;
}

@keyframes toast-hide {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-10px); opacity: 0; }
}

/* === HEART PARTICLES === */
.heart-particle {
    position: absolute;
    font-size: 20px;
    pointer-events: none;
    animation: heart-float 0.8s ease-out forwards;
}

@keyframes heart-float {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-60px); }
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* === PREVENT TEXT SELECTION === */
#game-container * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#game-container input {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* === PWA STANDALONE === */
@media (display-mode: standalone) {
    /* Safe areas handled by #game-container and .bottom-nav */
}

/* === LANDSCAPE WARNING === */
@media (max-height: 500px) and (orientation: landscape) {
    body::before {
        content: 'Draai je scherm voor de beste ervaring';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-dark);
        color: var(--text-light);
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 18px;
        z-index: 9999;
        text-align: center;
        padding: 20px;
    }
}

/* === MOOD INDICATOR === */
/* Position is set in location system section */

.mood-emoji {
    font-size: 16px;
}

.mood-text {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.mood-indicator.happy .mood-text { color: var(--success); }
.mood-indicator.neutral .mood-text { color: var(--warning); }
.mood-indicator.sad .mood-text { color: var(--danger); }
.mood-indicator.sick .mood-text { color: var(--danger); }
.mood-indicator.sleeping .mood-text { color: var(--info); }

/* === SICK INDICATOR === */
.sick-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 28px;
    animation: sick-pulse 1s ease-in-out infinite;
}

@keyframes sick-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* === SLEEP INDICATOR === */
.sleep-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    animation: sleep-float 2s ease-in-out infinite;
}

@keyframes sleep-float {
    0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(-10px) scale(1.1); opacity: 0.7; }
}

/* === EVOLUTION PROGRESS === */
.evolution-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 280px;
    padding: 10px 0;
}

.evo-label {
    font-size: 10px;
    color: var(--text-dark);
    white-space: nowrap;
}

.evo-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-light);
    border-radius: 3px;
    overflow: hidden;
}

.evo-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--danger), var(--warning), var(--success));
    background-size: 300% 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 100%;
}

.evo-percent {
    font-size: 10px;
    color: var(--text-muted);
    min-width: 35px;
    text-align: right;
}

/* === ACTION BADGES === */
.action-btn {
    position: relative;
}

.action-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger);
    color: var(--white);
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badge-pulse 2s ease-in-out infinite;
}

.action-badge.poop-badge {
    background: #8B4513;
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* === SOUND INDICATOR === */
.sound-indicator {
    position: absolute;
    top: 90px;
    right: 15px;
    background: var(--bg-card);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
    z-index: 10;
}

.sound-indicator:hover {
    opacity: 1;
    background: var(--bg-light);
}

.sound-indicator.muted {
    opacity: 0.4;
}

/* === CONFETTI === */
#confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 300;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 0;
    animation: confetti-fall 3s ease-out forwards;
}

.confetti.circle { border-radius: 50%; }
.confetti.square { border-radius: 2px; }

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translateY(-10px) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(700px) rotate(720deg);
    }
}

/* === TUTORIAL === */
.tutorial-content {
    text-align: center;
    padding: 30px 20px;
}

.tutorial-slide {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tutorial-emoji {
    font-size: 64px;
    margin-bottom: 20px;
    animation: tutorial-bounce 1s ease-in-out infinite;
}

@keyframes tutorial-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.tutorial-title {
    font-size: 24px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.tutorial-text {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 280px;
}

.tutorial-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
}

.tutorial-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg-light);
    transition: all 0.2s;
}

.tutorial-dot.active {
    background: var(--primary);
    width: 24px;
    border-radius: 4px;
}

.tutorial-skip {
    display: block;
    margin-top: 15px;
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s;
}

.tutorial-skip:hover {
    color: var(--text-muted);
}

/* === KEYBOARD HINTS === */
.keyboard-hints {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: 15px;
    background: var(--bg-card);
    padding: 8px 15px;
    border-radius: 20px;
    opacity: 0.7;
    font-size: 10px;
    color: var(--text-muted);
}

.keyboard-hints span {
    white-space: nowrap;
}

/* Show keyboard hints on desktop */
@media (hover: hover) and (pointer: fine) {
    .keyboard-hints {
        display: flex;
    }
}

/* === IMPROVED ANIMATIONS === */
.pet-container.interacting {
    animation: none;
    transform: scale(0.95);
}

.pet-container.happy-bounce {
    animation: happy-bounce 0.5s ease-out;
}

@keyframes happy-bounce {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.05) rotate(5deg); }
}

/* Wake up button style */
.action-btn.wake-mode {
    background: var(--info);
}

.action-btn.wake-mode span {
    color: var(--white);
}

/* Disabled action style */
.action-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* === GOLD CHANGE ANIMATION === */
.gold-display.gold-up {
    animation: gold-up 0.5s ease-out;
}

.gold-display.gold-down {
    animation: gold-down 0.5s ease-out;
}

@keyframes gold-up {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); color: var(--success); }
    100% { transform: scale(1); }
}

@keyframes gold-down {
    0% { transform: scale(1); }
    50% { transform: scale(0.9); color: var(--danger); }
    100% { transform: scale(1); }
}

/* === SHIMMER EFFECT FOR NEW ITEMS === */
.shop-item.new::after {
    content: 'NIEUW';
    position: absolute;
    top: 5px;
    left: 5px;
    background: var(--accent);
    color: var(--bg-dark);
    font-size: 8px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
}

/* === STAT BAR GLOW === */
.stat-fill.critical {
    box-shadow: 0 0 10px var(--danger);
}

/* === POOP PILE ANIMATION === */
.poop-indicator img {
    animation: poop-wiggle 2s ease-in-out infinite;
}

.poop-indicator img:nth-child(2) { animation-delay: 0.2s; }
.poop-indicator img:nth-child(3) { animation-delay: 0.4s; }
.poop-indicator img:nth-child(4) { animation-delay: 0.6s; }
.poop-indicator img:nth-child(5) { animation-delay: 0.8s; }

@keyframes poop-wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

/* === NEW CATCH GAME (Falling Stars) === */
.catch-area-new {
    position: relative;
    height: 250px;
    display: flex;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.catch-lane {
    flex: 1;
    position: relative;
    border-right: 1px solid var(--bg-light);
}

.catch-lane:last-of-type {
    border-right: none;
}

.catch-star-falling {
    position: absolute;
    font-size: 28px;
    left: 50%;
    transform: translateX(-50%);
    transition: top 0.05s linear;
    z-index: 5;
}

.catch-basket-new {
    position: absolute;
    bottom: 10px;
    font-size: 36px;
    transition: left 0.15s ease-out;
    z-index: 10;
    transform: translateX(-50%);
}

.catch-instructions {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 10px;
}

/* === QUIZ GAME === */
.quiz-question {
    font-size: 18px;
    color: var(--text-light);
    text-align: center;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-width: 320px;
    margin: 0 auto;
}

.quiz-btn {
    padding: 15px 10px;
    font-size: 16px;
    background: var(--bg-card);
    border: 2px solid var(--bg-light);
    border-radius: 12px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.quiz-btn.correct {
    background: var(--success);
    border-color: var(--success);
}

.quiz-btn.wrong {
    background: var(--danger);
    border-color: var(--danger);
}

/* === BALLOON GAME === */
.balloon-area {
    position: relative;
    height: 300px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.balloon {
    position: absolute;
    font-size: 40px;
    cursor: pointer;
    transition: transform 0.1s;
    animation: balloon-float 0.5s ease-in-out infinite alternate;
    z-index: 5;
}

.balloon:hover {
    transform: scale(1.1);
}

.balloon.popped {
    animation: balloon-pop 0.3s ease-out forwards;
}

@keyframes balloon-float {
    0% { transform: translateX(-5px); }
    100% { transform: translateX(5px); }
}

@keyframes balloon-pop {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(0); opacity: 0; }
}

.balloon-instruction {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* === COLOR MATCH GAME (Stroop) === */
.colormatch-display {
    text-align: center;
    padding: 30px;
    margin-bottom: 20px;
}

.colormatch-word {
    font-size: 42px;
    font-weight: bold;
    margin-bottom: 10px;
}

.colormatch-instruction {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.colormatch-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-width: 280px;
    margin: 0 auto;
}

.colormatch-btn {
    padding: 15px 20px;
    font-size: 16px;
    font-weight: bold;
    border: 3px solid var(--bg-light);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--white);
}

.colormatch-btn:hover {
    transform: scale(1.05);
    border-color: var(--white);
}

.colormatch-btn.correct {
    animation: correct-flash 0.3s ease-out;
}

.colormatch-btn.wrong {
    animation: wrong-flash 0.3s ease-out;
}

@keyframes correct-flash {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 20px var(--success); }
}

@keyframes wrong-flash {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 20px var(--danger); }
}

/* === SNAKE GAME === */
.snake-area {
    display: grid;
    gap: 1px;
    background: var(--bg-light);
    border-radius: 12px;
    padding: 5px;
    margin: 0 auto 15px;
    touch-action: none;
}

.snake-cell {
    width: 18px;
    height: 18px;
    background: var(--bg-card);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.snake-cell.snake {
    background: var(--success);
    border-radius: 4px;
}

.snake-cell.snake-head {
    background: var(--secondary-dark);
}

.snake-cell.food {
    background: var(--danger);
    border-radius: 50%;
    animation: food-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes food-pulse {
    0% { transform: scale(0.8); }
    100% { transform: scale(1); }
}

.snake-controls {
    display: grid;
    grid-template-columns: repeat(3, 50px);
    grid-template-rows: repeat(2, 50px);
    gap: 5px;
    justify-content: center;
    margin-top: 15px;
}

.snake-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 8px;
    background: var(--bg-light);
    color: var(--text-light);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.1s;
}

.snake-btn:active {
    background: var(--primary);
    transform: scale(0.95);
}

.snake-instruction {
    font-size: 11px;
    color: var(--text-dark);
    text-align: center;
    margin-top: 10px;
}

/* === DICE GAME === */
.dice-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.dice {
    width: 70px;
    height: 70px;
    background: var(--white);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;
}

.dice.rolling {
    animation: dice-roll 0.5s ease-in-out;
}

@keyframes dice-roll {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.1); }
    50% { transform: rotate(180deg) scale(1); }
    75% { transform: rotate(270deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

.dice-prediction {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.dice-bet-btn {
    padding: 12px 20px;
    border: 2px solid var(--bg-light);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-light);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
}

.dice-bet-btn:hover {
    border-color: var(--primary);
    background: var(--primary);
}

.dice-bet-btn.selected {
    border-color: var(--gold);
    background: var(--primary);
}

.dice-result {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin: 15px 0;
}

.dice-result.win { color: var(--success); }
.dice-result.lose { color: var(--danger); }

/* === TYPING GAME === */
.typing-area {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    min-height: 120px;
}

.typing-word {
    font-size: 28px;
    font-weight: bold;
    color: var(--gold);
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.typing-input {
    width: 100%;
    padding: 15px;
    font-size: 20px;
    font-family: inherit;
    text-align: center;
    background: var(--bg-light);
    border: 2px solid var(--bg-light);
    border-radius: 10px;
    color: var(--text-light);
    outline: none;
    transition: border-color 0.2s;
}

.typing-input:focus {
    border-color: var(--primary);
}

.typing-input.correct {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.typing-input.wrong {
    border-color: var(--danger);
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.typing-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    font-size: 14px;
    color: var(--text-muted);
}

.typing-stat {
    text-align: center;
}

.typing-stat-value {
    font-size: 20px;
    font-weight: bold;
    color: var(--gold);
}

/* === MAZE GAME === */
.maze-area {
    display: grid;
    gap: 1px;
    background: var(--bg-light);
    border-radius: 12px;
    padding: 5px;
    margin: 0 auto 15px;
    touch-action: none;
}

.maze-cell {
    width: 22px;
    height: 22px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.maze-cell.wall {
    background: var(--bg-dark);
}

.maze-cell.player {
    background: var(--primary);
    border-radius: 50%;
}

.maze-cell.exit {
    background: var(--success);
    animation: exit-glow 1s ease-in-out infinite alternate;
}

@keyframes exit-glow {
    0% { box-shadow: 0 0 5px var(--success); }
    100% { box-shadow: 0 0 15px var(--success); }
}

.maze-controls {
    display: grid;
    grid-template-columns: repeat(3, 45px);
    grid-template-rows: repeat(2, 45px);
    gap: 5px;
    justify-content: center;
    margin-top: 10px;
}

.maze-btn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 8px;
    background: var(--bg-light);
    color: var(--text-light);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.1s;
}

.maze-btn:active {
    background: var(--primary);
    transform: scale(0.95);
}

.maze-instruction {
    font-size: 11px;
    color: var(--text-dark);
    text-align: center;
    margin-top: 8px;
}

/* === SLOTS GAME === */
.slots-machine {
    background: linear-gradient(180deg, #2a1a4a 0%, #1a0a2e 100%);
    border-radius: 16px;
    padding: 20px;
    margin: 0 auto 15px;
    max-width: 280px;
    border: 3px solid var(--gold);
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.3);
}

.slots-display {
    display: flex;
    justify-content: center;
    gap: 10px;
    background: var(--bg-dark);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.slot-reel {
    width: 60px;
    height: 70px;
    background: var(--white);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    overflow: hidden;
    position: relative;
}

.slot-reel.spinning {
    animation: slot-spin 0.1s linear infinite;
}

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

.slots-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    background: linear-gradient(180deg, var(--danger) 0%, #b91c1c 100%);
    border: none;
    border-radius: 10px;
    color: var(--white);
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.slots-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(239, 68, 68, 0.4);
}

.slots-btn:active {
    transform: scale(0.98);
}

.slots-btn:disabled {
    background: var(--bg-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.slots-payouts {
    margin-top: 15px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

.slots-payout-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 10px;
}

.slots-result {
    text-align: center;
    margin: 15px 0;
    font-size: 20px;
    font-weight: bold;
}

.slots-result.jackpot {
    color: var(--gold);
    animation: jackpot-flash 0.3s ease-in-out infinite alternate;
}

@keyframes jackpot-flash {
    0% { text-shadow: 0 0 10px var(--gold); }
    100% { text-shadow: 0 0 30px var(--gold), 0 0 60px var(--gold); }
}

/* === LOCATION SYSTEM === */

/* Location Indicator */
.location-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    padding: 6px 12px;
    border-radius: 20px;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    font-size: 12px;
}

.mood-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    padding: 6px 12px;
    border-radius: 20px;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.location-emoji {
    font-size: 16px;
}

.location-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
}

.location-time {
    font-size: 11px;
    color: var(--text-light);
    margin-left: 4px;
}

.location-daynight {
    font-size: 14px;
    margin-left: 2px;
}

.location-home-btn {
    background: var(--primary);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 14px;
    cursor: pointer;
    margin-left: 5px;
    transition: all 0.2s;
}

.location-home-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* Gather Button */
.gather-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--secondary);
    border: none;
    border-radius: 25px;
    color: var(--white);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    margin: 10px 0;
}

.gather-btn:hover {
    background: var(--secondary-dark);
    transform: scale(1.05);
}

.gather-btn:active {
    transform: scale(0.98);
}

.gather-btn:disabled {
    background: var(--bg-light);
    cursor: not-allowed;
    opacity: 0.6;
}

.gather-icon {
    font-size: 18px;
}

.gather-cooldown {
    font-size: 12px;
    opacity: 0.8;
}

.gather-energy {
    font-size: 12px;
    opacity: 0.9;
}

/* NPC Indicator */
.npc-indicator {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: var(--accent);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: npc-pulse 2s ease-in-out infinite;
    cursor: pointer;
}

.npc-indicator:hover {
    transform: scale(1.1);
}

.npc-emoji {
    font-size: 20px;
}

@keyframes npc-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
}

/* NPC Talk Button */
.npc-talk-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent);
    border: none;
    border-radius: 20px;
    color: var(--bg-dark);
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    margin: 5px 0;
}

.npc-talk-btn:hover {
    background: #d97706;
    transform: scale(1.05);
}

.npc-talk-icon {
    font-size: 16px;
}

/* === LOCATION MODAL === */
.location-current {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 10px;
    margin-bottom: 15px;
}

.current-label {
    font-size: 12px;
    color: var(--text-muted);
}

.current-location {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-light);
}

.travel-stats {
    display: flex;
    gap: 15px;
    font-size: 14px;
}

.travel-gold {
    color: var(--gold);
}

.travel-energy {
    color: var(--info);
}

.location-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}

.location-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    background: var(--bg-card);
    border: 2px solid var(--bg-light);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    position: relative;
}

.location-card:hover:not(.locked):not(.current) {
    background: var(--bg-light);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.location-card.current {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.location-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.location-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 14px;
}

.location-card-emoji {
    font-size: 36px;
}

.location-card-name {
    font-size: 13px;
    font-weight: bold;
    color: var(--text-light);
}

.location-card-cost {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

.location-card-cost .cost-gold {
    color: var(--gold);
}

.location-card-cost .cost-energy {
    color: var(--info);
}

.location-card-unlock {
    font-size: 10px;
    color: var(--warning);
}

/* === QUEST SYSTEM === */

/* Quest Tabs */
.quest-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.quest-tab {
    flex: 1;
    padding: 10px;
    background: var(--bg-card);
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.quest-tab.active {
    background: var(--primary);
    color: var(--white);
}

/* Quest Panels */
.quest-panel {
    max-height: 400px;
    overflow-y: auto;
}

/* Daily Quest Item */
.daily-quest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--bg-light);
    border-radius: 10px;
    margin-bottom: 10px;
}

.daily-quest-item.completed {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.daily-quest-item.claimed {
    opacity: 0.6;
}

.quest-emoji {
    font-size: 28px;
}

.quest-info {
    flex: 1;
}

.quest-name {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-light);
}

.quest-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.quest-progress {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.quest-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-light);
    border-radius: 3px;
    overflow: hidden;
}

.quest-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s;
}

.quest-progress-text {
    font-size: 10px;
    color: var(--text-muted);
    min-width: 35px;
    text-align: right;
}

.quest-reward {
    font-size: 14px;
    font-weight: bold;
    color: var(--gold);
    background: rgba(251, 191, 36, 0.15);
    padding: 5px 12px;
    border-radius: 15px;
}

.quest-claim-btn {
    padding: 8px 16px;
    background: var(--success);
    border: none;
    border-radius: 15px;
    color: var(--white);
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.quest-claim-btn:hover {
    background: var(--secondary-dark);
}

/* Active Quest Item */
.active-quest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border: 2px solid var(--warning);
    border-radius: 10px;
    margin-bottom: 10px;
}

.active-quest-item.story-quest {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.quest-timer {
    font-size: 12px;
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 4px;
}

.quest-timer.urgent {
    color: var(--danger);
    animation: timer-pulse 0.5s ease-in-out infinite;
}

/* Story Quest Item */
.story-quest-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    background: var(--bg-card);
    border: 1px solid var(--bg-light);
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.story-quest-item > .quest-emoji {
    font-size: 24px;
}

.story-quest-item > .quest-info {
    flex: 1;
}

.story-quest-item:hover:not(.locked):not(.completed) {
    background: var(--bg-light);
    border-color: var(--primary);
}

.story-quest-item.completed {
    opacity: 0.7;
    border-color: var(--success);
}

.story-quest-item.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.story-quest-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.story-chapter {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.story-accept-btn {
    align-self: flex-start;
}

.story-check {
    font-size: 16px;
    color: var(--success);
}

/* Story Progress Bar */
.story-progress-bar {
    height: 24px;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
}

.story-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.5s ease;
}

.story-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
    color: var(--text-light);
}

/* === NPC MODAL === */
.npc-portrait {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--accent);
}

.npc-portrait-emoji {
    font-size: 50px;
}

.npc-portrait-emoji.has-svg {
    font-size: inherit;
}

.npc-portrait-emoji.has-svg svg {
    width: 60px;
    height: 60px;
}

/* SVG Icons */
.icon-svg svg {
    width: 1em;
    height: 1em;
    vertical-align: middle;
}

.has-svg svg {
    max-width: 100%;
    max-height: 100%;
}

.header-emoji.has-svg svg {
    width: 24px;
    height: 24px;
}

.npc-role {
    text-align: center;
    font-size: 14px;
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 5px;
}

.npc-description {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.npc-dialogue {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.npc-dialogue::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-bottom-color: var(--bg-light);
}

.npc-dialogue p {
    font-size: 14px;
    color: var(--text-light);
    font-style: italic;
    text-align: center;
}

.npc-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.npc-action-btn {
    flex: 1;
}

.npc-trades h3 {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.trade-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.trade-item:hover:not(.disabled) {
    background: var(--bg-light);
}

.trade-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.trade-give, .trade-receive {
    flex: 1;
    font-size: 13px;
}

.trade-give {
    color: var(--danger);
}

.trade-receive {
    color: var(--success);
    text-align: right;
}

.trade-arrow {
    font-size: 18px;
    color: var(--text-muted);
}

/* NPC Quests */
.npc-quests {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--bg-light);
}

.npc-quests h3 {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.npc-quest-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--bg-light);
    border-radius: 8px;
    margin-bottom: 8px;
}

.npc-quest-item.completed {
    opacity: 0.6;
    border-color: var(--success);
}

.npc-quest-item.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.npc-quest-item.locked {
    opacity: 0.5;
}

.npc-quest-item.ready-to-turn-in {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.npc-quest-item .quest-status.ready {
    color: var(--success);
    background: rgba(34, 197, 94, 0.2);
}

.npc-quest-item .quest-emoji {
    font-size: 20px;
}

.npc-quest-item .quest-info {
    flex: 1;
}

.npc-quest-item .quest-name {
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 4px;
}

.npc-quest-item .quest-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.npc-quest-item .quest-reward {
    font-size: 11px;
    color: var(--gold);
    margin-top: 4px;
}

.npc-quest-item .quest-check {
    color: var(--success);
    font-size: 18px;
}

.npc-quest-item .quest-status {
    font-size: 11px;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

.npc-quest-item .quest-locked {
    font-size: 16px;
    opacity: 0.5;
}

.npc-quest-accept {
    flex-shrink: 0;
}

/* NPC Quest Turn-in */
.npc-turn-in {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
    border: 2px solid var(--success);
    border-radius: 12px;
    animation: turnInGlow 2s ease-in-out infinite;
}

@keyframes turnInGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
    }
}

.turn-in-quest {
    display: flex;
    align-items: center;
    gap: 12px;
}

.turn-in-quest .quest-emoji {
    font-size: 28px;
}

.turn-in-quest .quest-info {
    flex: 1;
}

.turn-in-quest .quest-name {
    font-weight: 600;
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 4px;
}

.turn-in-quest .quest-reward {
    font-size: 13px;
    color: var(--gold);
    font-weight: 500;
}

.turn-in-btn {
    background: var(--success) !important;
    color: white !important;
    font-weight: 600;
    padding: 10px 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

.turn-in-btn:hover {
    background: #16a34a !important;
    transform: scale(1.05);
}

/* === COLLECTIBLES MODAL === */
.collectibles-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 10px;
}

.collectibles-count {
    font-size: 14px;
    color: var(--text-light);
}

.collectibles-value {
    color: var(--gold);
    font-weight: bold;
}

.sell-all-btn {
    padding: 8px 16px;
    background: var(--warning);
    border: none;
    border-radius: 15px;
    color: var(--bg-dark);
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.sell-all-btn:hover {
    background: #d97706;
}

.collectibles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-height: 350px;
    overflow-y: auto;
    padding: 5px;
}

.collectible-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 8px;
    background: var(--bg-card);
    border: 1px solid var(--bg-light);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    position: relative;
}

.collectible-item:hover {
    background: var(--bg-light);
    transform: translateY(-2px);
}

.collectible-item.legendary {
    border-color: var(--gold);
    background: rgba(251, 191, 36, 0.1);
}

.collectible-item.rare {
    border-color: var(--info);
    background: rgba(59, 130, 246, 0.1);
}

.collectible-emoji {
    font-size: 28px;
}

.collectible-name {
    font-size: 10px;
    color: var(--text-light);
    font-weight: 500;
}

.collectible-count {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--primary);
    color: var(--white);
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collectible-value {
    font-size: 10px;
    color: var(--gold);
}

.collectibles-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-emoji {
    font-size: 48px;
    margin-bottom: 15px;
}

.empty-hint {
    font-size: 12px;
    color: var(--text-dark);
    margin-top: 10px;
}

/* === RANDOM QUEST POPUP === */
.random-quest-popup {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    animation: popup-slide 0.3s ease-out;
}

@keyframes popup-slide {
    from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.random-quest-content {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 2px solid var(--warning);
    border-radius: 15px;
    padding: 12px 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.random-quest-emoji {
    font-size: 28px;
    animation: pulse 1s ease-in-out infinite;
}

.random-quest-info {
    display: flex;
    flex-direction: column;
}

.random-quest-title {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-light);
}

.random-quest-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.random-quest-timer {
    font-size: 11px;
    color: var(--warning);
}

.random-quest-accept {
    padding: 8px 16px;
    background: var(--success);
    border: none;
    border-radius: 15px;
    color: var(--white);
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.random-quest-accept:hover {
    background: var(--secondary-dark);
}

.random-quest-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
}

.random-quest-dismiss:hover {
    color: var(--danger);
}

/* === STORY DIALOGUE === */
.story-dialogue {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 250;
}

.story-dialogue-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 25px;
    max-width: 320px;
    text-align: center;
}

.story-speaker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.story-speaker-emoji {
    font-size: 32px;
}

.story-speaker-name {
    font-size: 16px;
    font-weight: bold;
    color: var(--accent);
}

.story-text {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 20px;
}

.story-continue {
    width: 100%;
}

/* === HEADER EMOJI STYLE === */
.header-emoji {
    font-size: 20px;
    margin-right: 8px;
}

/* === LOCATION BACKGROUNDS === */
.pet-area.location-home { background: linear-gradient(180deg, rgba(99, 102, 241, 0.2) 0%, var(--bg-dark) 100%); }
.pet-area.location-park { background: linear-gradient(180deg, rgba(34, 197, 94, 0.2) 0%, var(--bg-dark) 100%); }
.pet-area.location-town { background: linear-gradient(180deg, rgba(251, 191, 36, 0.2) 0%, var(--bg-dark) 100%); }
.pet-area.location-forest { background: linear-gradient(180deg, rgba(22, 163, 74, 0.3) 0%, var(--bg-dark) 100%); }
.pet-area.location-beach { background: linear-gradient(180deg, rgba(59, 130, 246, 0.2) 0%, var(--bg-dark) 100%); }
.pet-area.location-farm { background: linear-gradient(180deg, rgba(234, 179, 8, 0.2) 0%, var(--bg-dark) 100%); }
.pet-area.location-lake { background: linear-gradient(180deg, rgba(14, 165, 233, 0.2) 0%, var(--bg-dark) 100%); }
.pet-area.location-mountain { background: linear-gradient(180deg, rgba(148, 163, 184, 0.3) 0%, var(--bg-dark) 100%); }
.pet-area.location-library { background: linear-gradient(180deg, rgba(139, 92, 246, 0.2) 0%, var(--bg-dark) 100%); }
.pet-area.location-arcade { background: linear-gradient(180deg, rgba(236, 72, 153, 0.2) 0%, var(--bg-dark) 100%); }
.pet-area.location-school { background: linear-gradient(180deg, rgba(239, 68, 68, 0.2) 0%, var(--bg-dark) 100%); }
.pet-area.location-cave { background: linear-gradient(180deg, rgba(30, 27, 75, 0.5) 0%, var(--bg-dark) 100%); }

/* Quest notification badge on nav */
.nav-btn .quest-badge {
    position: absolute;
    top: 5px;
    right: 50%;
    transform: translateX(15px);
    background: var(--danger);
    color: var(--white);
    font-size: 9px;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === AUTH MODAL === */
.auth-modal-content {
    max-width: 340px;
}

.auth-form {
    padding: 10px 0;
}

.auth-description {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.5;
}

.auth-input-group {
    margin-bottom: 15px;
}

.auth-input-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.auth-input-group input {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 15px;
    background: var(--bg-light);
    border: 2px solid #475569;
    border-radius: 10px;
    color: var(--text-light);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.auth-input-group input::placeholder {
    color: var(--text-dark);
}

.auth-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 15px;
    font-size: 13px;
    color: var(--danger);
}

.auth-switch {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 15px;
}

.auth-switch-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.auth-switch-btn:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Logged In View */
.auth-user-info {
    text-align: center;
    padding: 20px 0;
}

.auth-avatar {
    width: 70px;
    height: 70px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 12px;
    border: 3px solid var(--primary);
}

.auth-username {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 10px;
}

.auth-sync-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
}

.auth-sync-status .sync-icon {
    font-size: 14px;
}

.auth-link-pet {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
}

.auth-link-pet p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Account button in settings */
#account-btn.logged-in {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--success);
}

#account-btn.logged-in:hover {
    background: rgba(34, 197, 94, 0.25);
}
