/* Smartphone overlay (public/js/phone.js) */
#phone-overlay { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: rgba(10, 20, 30, .45); backdrop-filter: blur(2px); font-family: "Trebuchet MS", "Segoe UI", sans-serif; }
#phone-overlay.hidden { display: none !important; }
.phone { width: 380px; height: min(760px, 92vh); background: #111; border: 6px solid #2b2b2b; border-radius: 36px; box-shadow: 0 20px 0 #1a1a1a, 0 30px 60px rgba(0,0,0,.6); display: flex; flex-direction: column; overflow: hidden; position: relative; }
.phone-notch { height: 26px; background: #111; position: relative; }
.phone-notch::after { content: ''; position: absolute; left: 50%; top: 6px; width: 120px; height: 16px; margin-left: -60px; background: #000; border-radius: 10px; }
.phone-status { display: flex; justify-content: space-between; padding: 2px 18px 6px; color: #fff; font-size: 13px; font-weight: bold; background: #111; }
.phone-screen { flex: 1; overflow-y: auto; background: linear-gradient(160deg, #f5efe2, #e8dcc4); color: #2b2b2b; padding: 14px; }
.phone-nav { display: flex; justify-content: space-around; padding: 8px; background: #111; }
.phone-nav button { background: #2b2b2b; color: #fff; border: 0; border-radius: 10px; width: 56px; height: 34px; font-size: 18px; cursor: pointer; }
.phone-nav button:hover { background: #444; }
.phone-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.phone-tile { position: relative; background: #fff7e6; border: 3px solid #2b2b2b; border-radius: 16px; padding: 10px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 4px 0 #2b2b2b; font-family: inherit; }
.phone-tile:active { transform: translateY(3px); box-shadow: 0 1px 0 #2b2b2b; }
.phone-tile .icon { font-size: 30px; }
.phone-tile .name { font-size: 12px; font-weight: bold; color: #2b2b2b; }
.phone-tile small { font-size: 10px; color: #888; }
.phone-tile.locked { opacity: .5; filter: grayscale(1); cursor: default; }
.phone-tile.pulse { animation: tile-pulse 1s ease-in-out infinite alternate; border-color: #e8541e; }
@keyframes tile-pulse { from { transform: scale(1); box-shadow: 0 4px 0 #2b2b2b; } to { transform: scale(1.06); box-shadow: 0 4px 0 #2b2b2b, 0 0 18px #e8541e; } }
.phone-tile .badge { position: absolute; top: -8px; right: -8px; background: #e8541e; color: #fff; border: 2px solid #2b2b2b; border-radius: 12px; min-width: 22px; height: 22px; font-size: 12px; font-weight: bold; line-height: 18px; }
.phone-hint { font-size: 12px; color: #666; margin-top: 16px; text-align: center; }
.phone-app h2 { margin: 0 0 10px; color: #e8541e; font-size: 20px; }
.phone-app .muted { color: #777; font-size: 12px; }
.market-list { display: flex; flex-direction: column; gap: 6px; }
.market-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; background: #fff7e6; border: 2px solid #2b2b2b; border-radius: 10px; padding: 6px 8px; }
.market-row.in-cart { border-color: #2f9e44; }
.m-name { font-weight: bold; font-size: 13px; }
.m-name small { display: block; font-weight: normal; font-size: 10px; color: #777; }
.m-price { font-size: 13px; font-weight: bold; white-space: nowrap; }
.m-price .up { color: #c0392b; margin-left: 3px; }
.m-price .down { color: #2f9e44; margin-left: 3px; }
.m-qty { display: flex; align-items: center; gap: 4px; }
.m-qty button { width: 26px; height: 26px; border: 2px solid #2b2b2b; border-radius: 6px; background: #e8541e; color: #fff; font-weight: bold; cursor: pointer; font-size: 15px; line-height: 1; }
.m-qty button:disabled { opacity: .35; cursor: default; }
.m-qty b { min-width: 18px; text-align: center; }
.market-foot { position: sticky; bottom: -14px; background: #e8dcc4; padding: 10px 0 4px; margin-top: 10px; border-top: 2px solid #2b2b2b; }
.market-foot .cart-line { font-size: 14px; }
.market-foot .error { color: #c0392b; font-size: 12px; min-height: 1.2em; margin: 4px 0; }
.market-foot .submit { width: 100%; padding: 10px; font-size: 16px; font-weight: bold; color: #fff; background: #2f9e44; border: 3px solid #2b2b2b; border-radius: 10px; box-shadow: 0 4px 0 #2b2b2b; cursor: pointer; font-family: inherit; }
.market-foot .submit:disabled { background: #999; cursor: default; }
.goal, .ticket-card, .news-item { background: #fff7e6; border: 2px solid #2b2b2b; border-radius: 10px; padding: 8px; margin-bottom: 8px; font-size: 13px; }
.goal.done { border-color: #2f9e44; }
.goal small { color: #777; }
.bar { height: 8px; background: rgba(0,0,0,.15); border-radius: 4px; overflow: hidden; margin-top: 5px; }
.bar div { height: 100%; background: #2f9e44; }
.setting { display: block; font-size: 14px; font-weight: bold; margin-bottom: 14px; }
.setting output { float: right; color: #e8541e; }
.setting input { width: 100%; margin-top: 6px; }
.market-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.market-tab { flex: 1; padding: 6px; border: 2px solid #2b2b2b; border-radius: 8px; background: #fff7e6; font-weight: bold; cursor: pointer; font-family: inherit; }
.market-tab.active { background: #e8541e; color: #fff; }
.campaign { background: #fff7e6; border: 2px solid #2b2b2b; border-radius: 10px; padding: 8px; margin-bottom: 8px; font-size: 13px; }
.campaign.active { border-color: #2f9e44; background: #eef9ea; }
.campaign.cooldown { opacity: .7; }
.campaign .c-head { display: flex; justify-content: space-between; font-size: 14px; }
.campaign .c-head em { font-style: normal; color: #e8541e; font-weight: bold; }
.campaign .c-body { color: #666; font-size: 12px; margin: 4px 0; }
.campaign .c-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #777; }
.campaign .buy { padding: 5px 14px; border: 2px solid #2b2b2b; border-radius: 8px; background: #2f9e44; color: #fff; font-weight: bold; cursor: pointer; font-family: inherit; }
.campaign .buy:disabled { background: #999; cursor: default; }
.phone-push { position: absolute; left: 12px; right: 12px; top: 46px; display: flex; gap: 8px; align-items: center; background: #fff; color: #2b2b2b; border: 2px solid #2b2b2b; border-radius: 12px; padding: 8px 12px; font-size: 13px; box-shadow: 0 6px 14px rgba(0,0,0,.35); cursor: pointer; z-index: 5; animation: push-in .3s ease-out; }
.phone-push .icon { font-size: 18px; }
@keyframes push-in { from { transform: translateY(-20px); opacity: 0; } to { transform: none; opacity: 1; } }
.market-foot .arrival { font-size: 13px; font-weight: bold; color: #2b2b2b; margin: 4px 0; }
.market-foot .express { display: block; font-size: 12px; margin: 4px 0; }
.market-foot .express.off { color: #999; }
.phone-app h3 { margin: 10px 0 6px; font-size: 14px; color: #555; }

/* level progression: items not unlocked yet */
.market-row.locked { opacity: .45; filter: grayscale(1); }
.market-row.locked small { color: #b45309; font-weight: bold; }

/* progression roadmap app */
.progress-list { display: flex; flex-direction: column; gap: 6px; }
.progress-row { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; border: 2px solid #2b2b2b; border-radius: 8px; background: #fff; font-size: 14px; }
.progress-row .p-day { font-weight: bold; color: #e8541e; }
.progress-row .p-badge { font-weight: bold; }
.progress-row.done { background: #eaf6ea; }
.progress-row.done .p-badge { color: #2f9e44; }
.progress-row.today { background: #fff2cc; border-color: #e8541e; }
.progress-row.today .p-badge { color: #e8541e; }
.progress-row.locked { opacity: .5; filter: grayscale(1); }
.phone-tile.locked { opacity: .45; filter: grayscale(1); }

/* tutorial: the one control to press next */
.tut-hint { outline: 3px solid #ff8a00 !important; outline-offset: 2px; animation: tutPulse .8s ease-in-out infinite alternate; position: relative; z-index: 1; }
@keyframes tutPulse { from { box-shadow: 0 0 0 0 rgba(255,138,0,.7); } to { box-shadow: 0 0 0 8px rgba(255,138,0,0); } }
