/* 像素小鳥 - 遊戲包裝與 UI 覆蓋層 */
:root {
    --primary-color: #e8a200;
    --primary-hover: #c48900;
    --border-color: rgba(0, 0, 0, 0.08);
}

body {
    background-color: #fcf8f2;
    font-family: 'Outfit', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 93px);
    gap: 16px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.game-header .logo {
    font-size: 1.8rem;
    font-weight: 900;
    color: #e85a19;
    text-shadow: 1px 1px 0 #fff, 2px 2px 0 #000;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
}

.game-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.game-container {
    position: relative;
    width: 320px;
    height: 550px;
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    background-color: #4EC0CA;
    border: 4px solid #fff;
}

#linkScreen {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated; /* 像素鳥原汁原味像素風 */
}

/* 排行榜覆蓋層 */
.overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    transition: opacity 0.3s ease;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid #000;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    width: 100%;
    max-width: 220px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: scale-up 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scale-up {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.overlay-content h2 {
    font-size: 1.5rem;
    font-weight: 900;
    color: #e85a19;
    margin-bottom: 8px;
    text-shadow: 1px 1px 0 #fff, 2px 2px 0 #000;
}

.overlay-content .subtitle {
    font-size: 1rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 16px;
}

.new-record-panel {
    background: rgba(232, 162, 0, 0.05);
    border: 2px dashed #e8a200;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.new-record-panel.hidden {
    display: none;
}

.glow-text {
    font-weight: 900;
    color: #e8a200;
    font-size: 0.9rem;
    margin-bottom: 8px;
    text-shadow: 1px 1px 0 #fff;
}

#nickname-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    border: 2px solid #000;
    border-radius: 6px;
    background: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

#nickname-input:focus {
    outline: none;
    border-color: #e8a200;
}

.primary-btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #000;
    background: #e8a200;
    color: #fff;
    font-weight: 900;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 3px 0 #9c6c00;
    transition: all 0.1s ease;
}

.primary-btn:hover {
    background: #d49300;
}

.primary-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #9c6c00;
}

.game-instruction {
    text-align: center;
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.5;
    background: rgba(0, 0, 0, 0.01);
    border: 1px solid rgba(0, 0, 0, 0.03);
    padding: 12px;
    border-radius: 12px;
}
