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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft JhengHei', sans-serif;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
}

/* 通用畫面樣式 */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    z-index: 100;
    pointer-events: none;
}

.screen.hidden {
    display: none;
}

.content {
    text-align: center;
    padding: 30px 25px;
    max-width: 340px;
    width: 85%;
    background: rgba(20, 20, 35, 0.70);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    animation: cardAppear 0.4s ease;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.game-title {
    font-size: 3.5em;
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    letter-spacing: 4px;
}

.subtitle {
    font-size: 1.2em;
    color: #aaa;
    margin-bottom: 40px;
}

/* 語言選擇器 */
.lang-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 1.4em;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.6;
}

.lang-btn:hover {
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.15);
}

.lang-btn.active {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

/* 簡化說明文字 */
.instruction-hint {
    color: #888;
    font-size: 0.9em;
    margin-top: 20px;
}

/* 舊版 instructions（保留相容） */
.instructions {
    margin-top: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.instructions p {
    color: #ddd;
    font-size: 1em;
    margin: 10px 0;
    line-height: 1.6;
}

.main-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 1.3em;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.main-btn:active {
    transform: scale(0.95);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.main-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 15px 40px;
    font-size: 1.1em;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 15px;
    transition: all 0.2s;
    font-family: inherit;
}

.secondary-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.2);
}

.verify-btn {
    margin: 20px 0 15px 0;
}

.verification-status {
    margin: 15px 0 8px 0;
    padding: 12px 20px;
    border-radius: 25px;
    text-align: center;
}

.status-unverified {
    color: #ffc107;
    font-size: 0.9em;
    font-weight: normal;
}

.status-verified {
    color: #2ecc71;
    font-size: 1em;
    font-weight: bold;
    display: inline-block;
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* NASDAQ-style Price Ticker */
.price-ticker {
    width: calc(100% + 50px);
    margin: 0 -25px 15px -25px;
    background: linear-gradient(90deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    border-top: 1px solid #0f3460;
    border-bottom: 1px solid #0f3460;
    overflow: hidden;
    position: relative;
}

.price-ticker::before,
.price-ticker::after {
    content: '';
    position: absolute;
    top: 0;
    width: 15px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.price-ticker::before {
    left: 0;
    background: linear-gradient(90deg, #1a1a2e 0%, transparent 100%);
}

.price-ticker::after {
    right: 0;
    background: linear-gradient(90deg, transparent 0%, #1a1a2e 100%);
}

.price-ticker.hidden {
    display: none;
}

.ticker-track {
    display: flex;
    white-space: nowrap;
    animation: tickerScroll 20s linear infinite;
}

.ticker-content {
    display: inline-flex;
    align-items: center;
    padding: 8px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    font-weight: bold;
    color: #00ff88;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
    letter-spacing: 1px;
    flex-shrink: 0;
}

.ticker-content .symbol {
    color: #ffd700;
}

.ticker-content .price {
    color: #00ff88;
}

.ticker-content .separator {
    color: #666;
    margin: 0 12px;
}

.ticker-content .ticker-airdrop {
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

@keyframes tickerScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* 遊戲 UI */
#game-ui {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    pointer-events: none;
}

#game-ui.hidden {
    display: none;
}

.top-bar {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat .label {
    color: #aaa;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.stat .value {
    color: #fff;
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hint {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1em;
    animation: pulse 2s infinite;
}

/* 完成畫面 */
.success-title {
    font-size: 2.5em;
    color: #4ade80;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
}

.fail-title {
    font-size: 2.5em;
    color: #f87171;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(248, 113, 113, 0.5);
}

.message {
    color: #ddd;
    font-size: 1.2em;
    margin-bottom: 30px;
}

.stats-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0 30px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    color: #ddd;
    font-size: 1.1em;
    margin: 12px 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-row:last-child {
    border-bottom: none;
    font-size: 1.3em;
    font-weight: bold;
    margin-top: 15px;
}

.highlight {
    color: #4ade80;
    font-weight: bold;
}

/* 精準度顯示 */
.accuracy-row {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    border-radius: 12px;
    padding: 12px 15px !important;
    margin-bottom: 15px !important;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.accuracy-value {
    font-size: 1.4em !important;
    font-weight: 900;
    text-shadow: 0 2px 10px currentColor;
    transition: color 0.3s ease;
}

/* 動畫 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* 版本號與設定 */
.version-container {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9999;
}

.version {
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.3);
    font-family: monospace;
}

.settings-btn {
    background: none;
    border: none;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s;
    opacity: 0.6;
}

.settings-btn:hover {
    opacity: 1;
    color: rgba(255, 255, 255, 0.6);
}

/* 設定面板（語言切換） */
.settings-panel {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 35, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    z-index: 9998;
    display: none;
    animation: slideUp 0.2s ease;
}

.settings-panel.show {
    display: block;
}

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

.settings-panel .lang-selector {
    margin: 0;
}

/* 驗證徽章（藍勾勾） */
.verification-badge {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #1da1f2 0%, #0d8ed9 100%);
    padding: 8px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(29, 161, 242, 0.4);
    animation: badgeAppear 0.5s ease-out;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.verification-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(29, 161, 242, 0.5);
}

.verification-badge:active {
    transform: scale(0.95);
}

.verification-badge.hidden {
    display: none;
}

.badge-icon {
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #1da1f2;
}

.badge-tooltip {
    color: white;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
}

/* Orb 驗證等級 - 金色邊框 */
.verification-badge.orb-verified {
    background: linear-gradient(135deg, #1da1f2 0%, #0d8ed9 100%);
    border: 2px solid #ffd700;
}

.verification-badge.orb-verified .badge-icon {
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    color: #1a1a1a;
}

@keyframes badgeAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(-20px);
    }
    50% {
        transform: scale(1.1) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 測試模式徽章 */
.verification-badge.test-mode {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.verification-badge.test-mode .badge-icon {
    color: #f59e0b;
}

/* ================================
   Token-nomics UI 樣式
   ================================ */

/* Token 觸發按鈕（遊戲畫面上） */
.token-trigger-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1000;
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    border: none;
    padding: 10px 16px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    color: #1a1a1a;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.token-trigger-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

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

/* Token 面板 */
.token-panel {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 35, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    z-index: 2000;
    min-width: 320px;
    max-width: 360px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: panelSlideUp 0.3s ease;
}

.token-panel.hidden {
    display: none;
}

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

/* 關閉按鈕 */
.close-panel-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #888;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-panel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Token 面板頭部 */
.token-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 15px;
    padding-right: 30px; /* 避免與關閉按鈕重疊 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cpk-balance {
    font-size: 1.4em;
    color: #ffd700;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.token-icon {
    font-size: 1.2em;
}

.token-symbol {
    font-size: 0.7em;
    color: #888;
    margin-left: 4px;
}

.claim-btn {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border: none;
    padding: 10px 24px;
    border-radius: 25px;
    color: #000;
    font-weight: bold;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.claim-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.claim-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 降速區塊 */
.slowdown-section {
    margin-bottom: 18px;
}

.slowdown-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #aaa;
    font-size: 1.05em;
    margin-bottom: 12px;
}

.slowdown-value {
    font-weight: bold;
    font-size: 1.2em;
    color: #888;
    transition: color 0.3s;
}

.slowdown-actions {
    display: flex;
    gap: 10px;
}

.slowdown-btn {
    flex: 1;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.4);
    padding: 14px 12px;
    border-radius: 14px;
    color: white;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.slowdown-btn:hover {
    background: rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.slowdown-btn:active {
    transform: translateY(0);
}

/* 特惠提示 */
.promo-hint {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 140, 0, 0.15));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 15px;
    text-align: center;
    color: #ffd700;
    font-size: 0.9em;
    font-weight: 600;
}

/* 功能說明提示 */
.feature-hint {
    text-align: center;
    color: #666;
    margin-bottom: 10px;
}

.feature-hint small {
    font-size: 0.8em;
}

/* 徽章區塊 */
.badge-section {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.badge-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.15);
    padding: 14px 10px;
    border-radius: 14px;
    color: white;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 1.1em;
}

.badge-btn.l1 {
    border-color: rgba(205, 127, 50, 0.5);
}

.badge-btn.l1:hover {
    background: rgba(205, 127, 50, 0.15);
    border-color: #cd7f32;
    box-shadow: 0 4px 15px rgba(205, 127, 50, 0.3);
}

.badge-btn.l2 {
    border-color: rgba(192, 192, 192, 0.5);
}

.badge-btn.l2:hover {
    background: rgba(192, 192, 192, 0.15);
    border-color: #c0c0c0;
    box-shadow: 0 4px 15px rgba(192, 192, 192, 0.3);
}

.badge-btn.l3 {
    border-color: rgba(255, 215, 0, 0.5);
}

.badge-btn.l3:hover {
    background: rgba(255, 215, 0, 0.15);
    border-color: #ffd700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.badge-btn:hover {
    transform: translateY(-3px);
}

.badge-btn:active {
    transform: translateY(0);
}

.badge-btn small {
    display: block;
    font-size: 0.65em;
    color: #888;
    margin-top: 6px;
    font-weight: normal;
}

/* 徽章狀態 */
.badge-status {
    text-align: center;
    color: #666;
    font-size: 0.85em;
    padding-top: 5px;
}

/* Token Toast 提示 */
.token-toast {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 16px 32px;
    border-radius: 30px;
    font-size: 1em;
    z-index: 10000;
    text-align: center;
    white-space: pre-line;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: toastFade 3s ease-out forwards;
    max-width: 300px;
}

@keyframes toastFade {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    10% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* 領取等待確認提示 */
.claiming-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}

.claiming-overlay.hidden {
    display: none;
}

.claiming-content {
    background: rgba(30, 30, 30, 0.95);
    padding: 30px 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.claiming-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-top-color: #ffd700;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: claimSpin 1s linear infinite;
}

@keyframes claimSpin {
    to { transform: rotate(360deg); }
}

.claiming-text {
    color: white;
    font-size: 1.1em;
    font-weight: bold;
}

/* 評分提醒彈窗 */
.rating-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10002;
    animation: fadeIn 0.3s ease-out;
}

.rating-overlay.hidden {
    display: none;
}

.rating-content {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 320px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.rating-stars {
    font-size: 2.5em;
    margin: 15px 0;
    letter-spacing: 5px;
}

.rating-title {
    color: #ffd700;
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 10px;
}

.rating-message {
    color: #ccc;
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 20px;
}

.rating-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.rating-btn {
    padding: 12px 24px;
    border-radius: 25px;
    border: none;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rating-btn-primary {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
}

.rating-btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

.rating-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.rating-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

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

/* 獎勵彈出效果 */
.reward-popup {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.9), rgba(255, 140, 0, 0.9));
    padding: 20px 40px;
    border-radius: 50px;
    z-index: 10000;
    animation: rewardPop 2s ease-out forwards;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.5);
}

.reward-icon {
    font-size: 2em;
}

.reward-amount {
    font-size: 2em;
    font-weight: bold;
    color: #1a1a1a;
}

.reward-label {
    font-size: 1.2em;
    color: #333;
    font-weight: 600;
}

@keyframes rewardPop {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateX(-50%) scale(1.1);
    }
    30% {
        transform: translateX(-50%) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-50px);
    }
}

/* 完美停車獎勵彈出 */
.reward-popup.perfect-bonus {
    flex-direction: column;
    background: linear-gradient(135deg, rgba(255, 50, 100, 0.95), rgba(255, 100, 0, 0.95), rgba(255, 215, 0, 0.95));
    animation: perfectPop 2.5s ease-out forwards;
    box-shadow: 0 10px 60px rgba(255, 100, 0, 0.7);
}

.reward-popup.perfect-bonus .perfect-text {
    font-size: 0.9em;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-top: 5px;
}

@keyframes perfectPop {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.3) rotate(-10deg);
    }
    15% {
        opacity: 1;
        transform: translateX(-50%) scale(1.3) rotate(5deg);
    }
    25% {
        transform: translateX(-50%) scale(1) rotate(0deg);
    }
    35%, 45% {
        transform: translateX(-50%) scale(1.05);
    }
    40%, 50% {
        transform: translateX(-50%) scale(0.98);
    }
    75% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-80px);
    }
}

/* 完美停車標籤 */
.perfect-park-label {
    background: linear-gradient(135deg, #ff6600, #ffd700);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 20px rgba(255, 100, 0, 0.5);
    animation: perfectLabelPulse 1s ease-in-out infinite;
    margin-bottom: 15px;
}

.perfect-park-label.hidden {
    display: none;
}

@keyframes perfectLabelPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(255, 100, 0, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 30px rgba(255, 100, 0, 0.7);
    }
}

/* ================================
   排行榜樣式
   ================================ */

.leaderboard-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 20, 35, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    z-index: 3000;
    min-width: 320px;
    max-width: 380px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: panelSlideUp 0.3s ease;
}

.leaderboard-panel.hidden {
    display: none;
}

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

.leaderboard-header h2 {
    color: #ffd700;
    font-size: 1.3em;
    margin: 0;
}

.leaderboard-driver-number {
    text-align: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    color: #ddd;
    font-size: 1em;
}

.leaderboard-driver-number strong {
    color: #ffd700;
    font-size: 1.3em;
}

.leaderboard-subtitle {
    text-align: center;
    color: #888;
    font-size: 0.85em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-loading,
.leaderboard-empty {
    text-align: center;
    color: #888;
    padding: 30px 0;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: all 0.2s;
}

.leaderboard-row:hover {
    background: rgba(255, 255, 255, 0.1);
}

.leaderboard-row.is-me {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    border: 1px solid rgba(102, 126, 234, 0.5);
}

.leaderboard-row .rank {
    width: 35px;
    font-size: 1.1em;
    color: #aaa;
}

.leaderboard-row .player-id {
    flex: 1;
    color: #ddd;
    font-family: monospace;
    font-size: 0.95em;
}

.leaderboard-row.is-me .player-id {
    color: #fff;
    font-weight: bold;
    font-family: inherit;
}

.leaderboard-row .score {
    color: #4ade80;
    font-weight: bold;
    font-size: 1em;
}

.leaderboard-separator {
    text-align: center;
    padding: 10px 0;
    color: #666;
    font-size: 1.2em;
    letter-spacing: 3px;
}

.leaderboard-my-rank {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    font-size: 0.95em;
}

.leaderboard-my-rank strong {
    color: #ffd700;
    font-size: 1.2em;
}

/* 響應式設計 */
@media (max-width: 480px) {
    .game-title {
        font-size: 2.5em;
    }

    .stat .value {
        font-size: 1.2em;
    }

    .main-btn {
        padding: 15px 40px;
        font-size: 1.1em;
    }

    .token-panel {
        min-width: 290px;
        max-width: 95%;
        padding: 15px;
    }

    .badge-btn {
        padding: 12px 8px;
        font-size: 1em;
    }

    .badge-btn small {
        font-size: 0.6em;
    }
}

/* ========================================
   Game Over 高分與排名樣式
   ======================================== */

.gameover-content {
    text-align: center;
}

.highscore-section {
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 140, 0, 0.1));
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 12px;
    animation: pulse-gold 2s ease-in-out infinite;
}

.highscore-section.hidden {
    display: none;
}

@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 25px rgba(255, 215, 0, 0.6); }
}

.highscore-badge {
    font-size: 1.2em;
    color: #ffd700;
    font-weight: bold;
    margin-bottom: 8px;
}

.highscore-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.rank-section {
    margin: 15px 0 20px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.rank-section.hidden {
    display: none;
}

.rank-info {
    font-size: 1.1em;
    color: #ddd;
}

.rank-value {
    font-weight: bold;
    color: #fff;
    font-size: 1.3em;
}

.rank-change {
    margin-left: 8px;
    font-weight: bold;
}

.rank-change.up {
    color: #4ade80;
}

.rank-change.down {
    color: #f87171;
}

.rank-change.same {
    color: #9ca3af;
}

/* Game Over 驗證提示區塊 */
.gameover-verify-section {
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.1));
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
}

.gameover-verify-section.hidden {
    display: none;
}

.gameover-verify-section .verify-hint {
    color: #bbb;
    font-size: 0.9em;
    margin-bottom: 12px;
}

.gameover-verify-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.gameover-verify-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.gameover-verify-btn:active {
    transform: translateY(0);
}

.gameover-verify-btn .verify-icon {
    font-size: 1.2em;
}

/* ========================================
   復活彈窗樣式
   ======================================== */

.revive-content {
    text-align: center;
}

.revive-title {
    font-size: 2em;
    margin-bottom: 10px;
    color: #ffd700;
}

.revive-level-info {
    font-size: 1.1em;
    color: #aaa;
    margin-bottom: 10px;
}

.revive-message {
    font-size: 1em;
    color: #ccc;
    margin-bottom: 25px;
}

.revive-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.revive-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 25px;
    border-radius: 16px;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    font-family: inherit;
}

.revive-btn.wld {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
    border-color: rgba(59, 130, 246, 0.5);
    color: white;
}

.revive-btn.wld:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(59, 130, 246, 0.2));
    border-color: #3b82f6;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.revive-btn.cpk {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 140, 0, 0.1));
    border-color: rgba(255, 215, 0, 0.5);
    color: white;
}

.revive-btn.cpk:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.4), rgba(255, 140, 0, 0.2));
    border-color: #ffd700;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}

.revive-btn.cpk.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.revive-icon {
    font-size: 2em;
}

.revive-price {
    font-size: 1.2em;
    font-weight: bold;
}

.revive-label {
    font-size: 0.9em;
    opacity: 0.8;
}

.skip-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #888;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95em;
    transition: all 0.2s;
}

.skip-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: #aaa;
}

/* 響應式 - 復活彈窗 */
@media (max-width: 480px) {
    .revive-options {
        flex-direction: column;
        gap: 12px;
    }

    .revive-btn {
        min-width: auto;
        width: 100%;
        padding: 15px 20px;
        flex-direction: row;
        justify-content: center;
    }

    .revive-icon {
        font-size: 1.5em;
    }
}



/* ================================
   分享菜單樣式
   ================================ */

.share-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 10001;
    animation: fadeIn 0.2s ease-out;
}

.share-menu-content {
    background: rgba(30, 30, 40, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px 20px 0 0;
    padding: 20px;
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

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

.share-menu-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: white;
}

.share-menu-header .close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
}

.share-option:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.share-option:active {
    transform: scale(0.98);
}

.share-icon {
    font-size: 1.5em;
    width: 35px;
    text-align: center;
}

/* 複製成功提示 */
.copy-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 200, 100, 0.95);
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: bold;
    z-index: 10002;
    animation: toastPop 2s ease-out forwards;
}

@keyframes toastPop {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    85% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

