@charset"UTF-8";
:root { --primary: #6366f1; --success: #10b981; --danger: #ef4444; --warning: #f59e0b; }
body { font-family: "Noto Sans TC", sans-serif; background: #f0f2f5; margin: 0; padding: 15px; }
.container { max-width: 1100px; margin: 0 auto; background: #fff; padding: 25px; border-radius: 28px; box-shadow: 0 20px 50px rgba(0,0,0,0.15); }

.header-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 5px; }
.stat-card { background: #f8fafc; padding: 15px 15px 0px 15px; border-radius: 18px; text-align: center; border: 1px solid #e2e8f0; }
.stat-val { font-size: 36px; font-weight: 800; color: var(--primary); display: block; }
.stat-hint { font-size: 18px; color: #64748b; margin-top: 5px; display: block; line-height: 1.4; }

.btn-reset { font-size: 16px; padding: 3px 10px; cursor: pointer; border-radius: 6px; border: 1px solid #e2e8f0; background: #fff; color: #64748b; transition: all 0.2s ease; font-weight: 500; margin:5px;}  
.btn-reset:hover { background: #f1f5f9; border-color: #cbd5e1; color: var(--danger); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }  
.btn-reset:active { transform: scale(0.95); } 

#ui-shop-name {font-size:20px;}
#game-canvas {
	height: 280px; background: linear-gradient(to bottom, #bae6fd 0%, #e0f2fe 100%); 
	border-radius: 20px; position: relative; overflow: hidden;
	margin-bottom: 5px; border: 6px solid #f1f5f9;
}
.shop-building { position: absolute; bottom: 0px; left: 50%; transform: translateX(-50%); z-index: 100; }
.sub-stores-container {
    position: absolute;
    width: 650px; 
    height: 120px;
    bottom: 30px; /* 稍微往上提，避開馬路與人行道接縫 */
    left: 50%;
    transform: translateX(-50%);
    /* 設定在路(10)與人(20)之間 */
    z-index: 15; 
    pointer-events: none;
}

.branch-icon {
    position: absolute;
    font-size: 70px;
    filter: saturate(0.6) brightness(0.9) drop-shadow(2px 2px 2px rgba(0,0,0,0.1)); /* 新增陰影 */
    z-index: 11;
    /* 讓分店看起來是有底部的，避免懸浮感 */
    transform-origin: bottom center; 
    transition: transform 0.3s ease;
}

.main-store-icon { font-size: 150px; line-height: 1; }
.sub-type-icon { 
	position: absolute; top: 20px; right: -30px; font-size: 55px; 
	background: white; border-radius: 50%; width: 75px; height: 75px;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 6px 12px rgba(0,0,0,0.2); border: 4px solid var(--primary);
}
.road { position: absolute; bottom: 0; width: 100%; height: 70px; background: #94a3b8; border-top: 5px solid #64748b; z-index: 10; }
.customer { position: absolute; font-size: 50px; bottom: 5px; left: 110%; z-index: 20; transition: left linear; }

.coin-pop {
	position: absolute; top: -30px; left: 50%; transform: translateX(-50%);
	z-index: 150; font-weight: 800; font-size: 32px; color: #f59e0b;
	display: flex; align-items: center; white-space: nowrap;
	animation: popUp 1s ease-out forwards;
}
@keyframes popUp {
	0% { opacity: 0; transform: translate(-50%, 0); }
	30% { opacity: 1; }
	100% { opacity: 0; transform: translate(-50%, -100px); }
}

.setup-grid { display: grid; grid-template-columns: 0.6fr 1.4fr; gap: 20px; margin-bottom: 5px; }
.strategy-history-area {max-height: 160px;overflow-y: auto;padding-right: 5px;}
.card { border: 1px solid #e5e7eb; padding: 10px; border-radius: 18px; background: #fafbfc; }
.card div { font-size: 16px !important; line-height: 1.2 !important; }


/* Modal Content 縮小約 20% */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.80); z-index: 1000; justify-content: center; align-items: center; }
.modal-content { background: white; padding: 10px 30px; border-radius: 28px; max-width: 760px; width: 90%; text-align: center; max-height: 90vh; overflow-y: auto; }

.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 15px; }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 20px; }

/* 選擇店型按鈕縮小 */
.btn-type, .btn-diff { background: white; border: 3px solid #e2e8f0; padding: 18px; border-radius: 16px; cursor: pointer; text-align: left; transition: 0.3s; }
.btn-type:hover, .btn-diff:hover { border-color: var(--primary); background: #f5f3ff; transform: translateY(-3px); }
.btn-type h4, .btn-diff h4 { margin: 0 0 8px 0; font-size: 22px; }
.btn-type p, .btn-diff p { margin: 0; font-size: 13px; color: #475569; line-height: 1.4; }

/* 策略按鈕縮小 20% */
.btn-buff-card {
	background: #fff;
	border: 3px solid #e5e7eb;
	border-radius: 16px;
	padding: 22px 15px;
	cursor: pointer;
	transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
}
.btn-buff-card:hover {
	border-color: var(--primary);
	background: #f5f3ff;
	transform: scale(1.03);
	box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.buff-name-label { font-size: 22px; font-weight: 900; color: #1f2937; }
.buff-desc-label { font-size: 16px; color: #4b5563; font-weight: 500; }
.buff-cost-label { 
	font-size: 19px; 
	font-weight: 800; 
	color: var(--danger); 
	background: #fee2e2;
	padding: 4px 12px;
	border-radius: 10px;
}

/* 主按鈕縮小 */
.btn-main { background: linear-gradient(135deg, #6366f1, #4338ca); color: white; width: 100%; padding: 16px; border-radius: 12px; font-size: 19px; font-weight: bold; border: none; cursor: pointer; margin: 4px 0; }
.btn-main:active {transform: scale(0.98); opacity: 0.9; }
.btn-main:disabled {background: #94a3b8 !important; cursor: not-allowed; transform: none; opacity: 0.7; }

.log { background: #0f172a; color: #cbd5e1; padding: 20px; border-radius: 15px; height: 120px; overflow-y: auto; font-family: monospace; font-size: 15px; border-left: 8px solid var(--primary); }
.status-tag { display: inline-block; background: #fee2e2; color: #991b1b; padding: 4px 10px; border-radius: 8px; margin: 4px; font-size: 14px; border: 1px solid #fecaca; }
.speed-controls { margin-top: 5px; display: flex; gap: 5px; justify-content: center; }
.btn-speed { 
	background: #e2e8f0; border: none; padding: 2px 8px; border-radius: 10px; 
	font-size: 30px !important; cursor: pointer; transition: 0.2s; font-weight: bold;
}
.btn-speed:hover { background: #cbd5e1; }
.btn-speed.active { background: var(--primary); color: white; }
.expanded-card {
	max-height: none !important; 
	height: auto !important;
}

.hidden-area {
	display: none !important;
}

#game-log.fully-visible {
	height: auto;
	max-height: auto; 
	overflow-y: visible;
}
.insufficient-funds-toast {
	position: fixed;
	top: 40%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(239, 68, 68, 0.95); /* 使用 var(--danger) 的顏色 */
	color: white;
	padding: 20px 40px;
	border-radius: 20px;
	font-size: 32px;
	font-weight: 900;
	z-index: 2000;
	box-shadow: 0 10px 30px rgba(0,0,0,0.3);
	pointer-events: none; /* 防止遮擋點擊 */
	animation: fadeOutUp 1.5s ease-out forwards;
}

@keyframes fadeOutUp {
	0% { opacity: 0; transform: translate(-50%, -20%); }
	20% { opacity: 1; transform: translate(-50%, -50%); }
	70% { opacity: 1; }
	100% { opacity: 0; transform: translate(-50%, -80%); }
}

#settle-detail-stats div {display: flex; flex-direction: column; justify-content: center; align-items: center; font-size:20px;}
#settle-detail-stats span {font-size: 24px;}
#settle-detail-stats {margin-top:-20px;}
.settle-detail-block {padding: 10px; border-radius: 12px;}

.settle-stats-container { display: grid; grid-template-columns: 1.4fr 1fr;  gap: 5px; margin-bottom: 5px; } 
.card-ops { border-radius: 12px; display: grid; grid-template-columns: 1fr 1fr 1fr; overflow: hidden; background: #eff6ff; border: 1px solid #dbeafe; }
.card-exp { border-radius: 12px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; background: #fff1f2; border: 1px solid #ffe4e6; }
.settle-grid-item { text-align: center; padding: 12px 5px; }
.card-ops .border-right { border-right: 1px solid #dbeafe; }
.card-exp .border-right { border-right: 1px solid #ffe4e6; }
.settle-stat-card small { color: #64748b; display: block; margin-bottom: 4px; font-size: 20px; } 
.settle-stat-card b { font-size: 24px;  font-weight: 800; }
.card-ops b { color: var(--primary); }
.card-exp b { color: var(--danger); }

#settle-report { font-size:20px; text-align:center; background:#f8fafc; padding:25px; border-radius:20px; line-height:1.6; border: 2px solid #e2e8f0; margin-bottom: 5px; }


#settle-modal h3 { font-size: 26px !important; margin-bottom: 15px !important; margin:5px;}

.Buff-detail {font-size: 18px; padding: 0px 8px; cursor: pointer; border-radius: 6px; border: 1px solid var(--primary); background: #f5f3ff; color: var(--primary);}
.settle-Buff-detail {font-size: 22px; margin-left:20px; padding: 0px 8px; cursor: pointer; border-radius: 6px; border: 1px solid var(--primary); background: #f5f3ff; color: var(--primary);}

#chart-container {
    margin-top: 5px;
    background: white;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    max-height: 200px; 
}

/* 確保畫布在容器內正確縮放 */
#businessChart {
    width: 100% !important;
    height: auto !important;
}