@font-face {
    font-family: "MisakiGothic";
    src: url("fonts/misaki_gothic.ttf") format("truetype");
    font-display: swap;
}

@keyframes blink {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

:root {
    --font-family: "MisakiGothic", "DotGothic16", monospace;
    --font-size: 16px;
    --bg-color: #ffffff;
    --text-color: #000000;
    --border-color: #000000;
    --border-width: 3px;
    --border-radius: 10px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: var(--font-size);
    line-height: 1;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 10px;
    box-sizing: border-box;
}

/* Header Section */
header {
    padding: 10px;
    margin-bottom: 10px;
}

.main-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 10px;
}

/* Navigation Section */
nav {
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius);
    width: 200px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

/* Content Section */
main {
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius);
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }

    nav {
        width: auto;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
        padding: 5px;
    }

    .nav-item {
        padding: 10px 5px;
        font-size: 14px;
    }

    main {
        padding: 15px;
    }

    /* Prevent overflow on mobile while allowing inner scroll */
    .container {
        height: auto;
    }
}

.nav-item {
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
}

.nav-item.active .nav-cursor {
    animation: blink 0.8s infinite steps(1);
}

.terminal-title {
    margin: 0;
    font-size: 24px;
    text-align: left;
}

.content-section h2 {
    font-size: 18px;
    border-bottom: var(--border-width) solid var(--border-color);
    margin-bottom: 15px;
    padding-bottom: 5px;
}

.atcoder-plot {
    font-family: "MisakiGothic", "Cascadia Code", monospace;
    white-space: pre;
    line-height: 1;
    letter-spacing: 0;
    overflow-x: auto;
    padding-bottom: 10px;
}

/* Scanline effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjJweCI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMXB4IiBmaWxsPSIjMDAwMDAwIiBmaWxsLW9wYWNpdHk9IjAuMTUiLz48L3N2Zz4=");
    background-repeat: repeat;
    background-size: auto 2px;
    pointer-events: none;
    z-index: 100;
}

a {
    color: var(--text-color);
    text-decoration: underline;
    text-underline-offset: 5px;
}

a:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
}
