* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #1b1d2a;
    color: #fff;
    font-family: 'Noto Sans JP', sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #2e3142;
}

.header-left h1 {
    font-size: 24px;
    margin-bottom: 5px;
    letter-spacing: 1px;
    font-weight: 700;
}

.info-row {
    display: flex;
    align-items: baseline;
    gap: 15px;
    font-size: 14px;
    color: #ccc;
}

.info-row span {
    display: inline-block;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

#clock {
    border: none;
    border-radius: 50%;
    background: transparent;
}

.toggle-button {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
    padding: 10px 20px;
    font-size: 16px;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    border-radius: 4px;
}

.toggle-button:hover {
    background: #fff;
    color: #000;
}

.flap-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: #191b26;
    padding: 5px;
    border: 2px solid #2e3142;
}

.loading {
    text-align: center;
    font-size: 20px;
    margin-top: 50px;
    color: #666;
}

.header-row {
    display: grid;
    grid-template-columns: 40px 120px 1fr 0.7fr 0.7fr 0.8fr 0.5fr;
    gap: 8px;
    margin-bottom: 5px;
    padding: 5px 0;
    border-bottom: 1px solid #444;
    font-weight: bold;
    color: #999;
    font-size: 12px;
}

.flight-row {
    display: grid;
    grid-template-columns: 40px 120px 1fr 0.7fr 0.7fr 0.8fr 0.5fr;
    gap: 8px;
    margin-bottom: 0;
    padding: 2px 0;
    border-bottom: none;
    align-items: center;
    background: #161823;
}

.airline-logo {
    font-size: 28px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    width: 50px;
    height: 50px;
    background-color: #222 !important;
    border-radius: 4px;
    border: 1px solid #333;
}

.airline-logo img {
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
}

.airline-emoji {
    font-size: 28px;
    line-height: 1;
}

.airline-name {
    font-size: 0.85em;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ccc;
}

.flap-display {
    background: #000;
    padding: 4px 6px;
    border: 1px solid #333;
    border-radius: 0;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 1px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

@media only screen and (max-width: 1024px) and (orientation: landscape) {
    .container {
        padding: 15px;
    }
    
    header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    header h1 {
        font-size: 22px;
        margin-bottom: 8px;
    }
    
    .info-row {
        font-size: 14px;
        gap: 20px;
    }
    
    #clock {
        width: 80px;
        height: 80px;
    }
    
    .toggle-button {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .flight-row {
        grid-template-columns: 2fr 1fr 1fr 1fr 0.8fr;
        gap: 10px;
        margin-bottom: 10px;
        padding: 8px 0;
    }
    
    .flap-display {
        padding: 3px;
        font-size: 14px;
    }
}

@media only screen and (device-width: 810px) and (device-height: 1080px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2) {
    html, body {
        -webkit-text-size-adjust: 100%;
    }
    
    .container {
        max-height: 810px;
        padding: 12px 20px;
    }
    
    header {
        margin-bottom: 15px;
        padding-bottom: 12px;
    }
    
    header h1 {
        font-size: 20px;
        letter-spacing: 1px;
    }
    
    .info-row {
        font-size: 13px;
    }
    
    .flight-row {
        margin-bottom: 8px;
        padding: 6px 0;
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #111;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}