* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    background: #12080c;
    color: #f5eef0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

#app {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    background: #231118;
    display: flex;
    flex-direction: column;
    position: relative;
    border-left: 1px solid #3d1b26;
    border-right: 1px solid #3d1b26;
    overflow-x: hidden;
}

/* MÀN HÌNH BẮT ĐẦU */
#screen-start {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #2f131e 0%, #160a0f 100%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    text-align: center;
}

.start-logo {
    font-size: 70px;
    margin-bottom: 8px;
    animation: floatAnim 3s ease-in-out infinite;
    cursor: pointer;
}

.start-title {
    font-size: 26px;
    font-weight: 900;
    color: #f5b945;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.start-subtitle {
    font-size: 13px;
    color: #d698a6;
    margin-bottom: 24px;
}

.shop-badge-info {
    background: #381826;
    border: 1px solid #ee5444;
    border-radius: 12px;
    padding: 14px 18px;
    width: 100%;
    max-width: 320px;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.6;
}

.start-menu-btns {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-start {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-start:active {
    transform: scale(0.97);
}

.btn-play {
    background: #ee5444;
    color: #fff;
    box-shadow: 0 4px 15px rgba(238,84,68,0.4);
}

.btn-guide {
    background: #381826;
    color: #f5b945;
    border: 1px solid #f5b945;
}

.btn-switch {
    background: #231118;
    color: #aaa;
    border: 1px solid #441f30;
}

/* POPUP MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18,8,12,0.96);
    z-index: 999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-card {
    background: #2c141e;
    border: 2px solid #ee5444;
    border-radius: 16px;
    width: 100%;
    max-width: 380px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 22px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.modal-card h2 {
    color: #f5b945;
    margin-bottom: 8px;
    font-size: 20px;
}

.modal-card p {
    font-size: 13px;
    color: #bbb;
    margin-bottom: 14px;
    line-height: 1.5;
}

.auth-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    background: #190a10;
    border: 1px solid #441f30;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.auth-input:focus {
    border-color: #ee5444;
}

.auth-switch {
    font-size: 12px;
    color: #f5b945;
    margin-top: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.auth-err {
    color: #ee5444;
    font-size: 13px;
    margin-bottom: 10px;
    display: none;
}

.guide-step {
    background: #1f0d15;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    text-align: left;
    font-size: 12px;
    border-left: 3px solid #f5b945;
}

.guide-step b {
    color: #f5b945;
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

/* BANNER TRẠNG THÁI NGÀY */
.day-banner {
    background: #2f1420;
    border: 1px solid #5a2638;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.tag-spoil {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #522334;
    color: #ff8577;
    margin-left: 4px;
}

.tag-safe {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #1e3d29;
    color: #77ff99;
    margin-left: 4px;
}

/* GIAO DIỆN GAMEPLAY */
#screen-game {
    display: none;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #160a0f;
    border-bottom: 1px solid #3d1b26;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 4px;
}

.badge {
    background: #2f1420;
    border: 1px solid #ee5444;
    border-radius: 18px;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: bold;
    color: #f5b945;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.btn-close-shop {
    background: #882424;
    color: #fff;
    border-color: #ee5444;
}

.stage {
    padding: 14px;
    background: linear-gradient(180deg, #361723 0%, #231118 100%);
    border-bottom: 2px solid #3d1b26;
    text-align: center;
}

.awning {
    width: 100%;
    height: 22px;
    border-radius: 6px 6px 0 0;
    background: repeating-linear-gradient(90deg, #ee5444, #ee5444 20px, #fdfbf7 20px, #fdfbf7 40px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    margin-bottom: 8px;
}

.kitchen-scene {
    width: 100%;
    height: 130px;
    background: #1a0b12;
    border-radius: 10px;
    border: 1px dashed #522334;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bowl-visual {
    font-size: 56px;
    animation: floatAnim 3s ease-in-out infinite;
    cursor: pointer;
}

.pet-badge {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 26px;
    cursor: pointer;
}

.nav-tabs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    background: #160a0f;
    border-bottom: 1px solid #3d1b26;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 2px;
    color: #9c828c;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: #f5b945;
    border-bottom: 2px solid #ee5444;
    background: #2c131e;
}

.viewport {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    padding-bottom: 40px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

.box {
    background: #2d1520;
    border: 1px solid #441f30;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.box-title {
    font-size: 14px;
    font-weight: bold;
    color: #f5b945;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.customer-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    background: #341825;
    border: 1px solid #ee5444;
    border-radius: 10px;
    padding: 10px;
}

.c-avatar {
    font-size: 32px;
    background: #1d0b13;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #f5b945;
}

.c-dialogue {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
}

.meter-wrap {
    width: 100%;
    height: 32px;
    background: #160a0f;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    display: flex;
    margin: 10px 0;
    border: 1px solid #522334;
}

.meter-zone {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: #fff;
}

.z-raw {
    width: 45%;
    background: #4a341b;
}

.z-perfect {
    width: 25%;
    background: #238647;
}

.z-over {
    width: 30%;
    background: #882424;
}

.needle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #fff;
    box-shadow: 0 0 6px #fff;
    left: 0%;
}

.step-tag {
    display: inline-block;
    background: #ee5444;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 4px;
}

.grid-select {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 8px 0;
}

.opt-btn {
    background: #1a0b12;
    border: 1px solid #441f30;
    color: #ddd;
    padding: 8px 4px;
    border-radius: 8px;
    font-size: 11px;
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.opt-btn.picked {
    border-color: #ee5444;
    background: #421a2a;
    color: #f5b945;
    font-weight: bold;
}

.item-thumb {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 6px;
}

.btn-main {
    width: 100%;
    padding: 12px;
    background: #ee5444;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    margin-top: 8px;
}

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

.btn-sm {
    width: auto;
    padding: 6px 12px;
    font-size: 12px;
}

.row-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #3d1b26;
    font-size: 13px;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}