@import url(https://fonts.googleapis.com/css2?family=Patua+One&family=Muli:wght@400;700&family=Kaushan+Script&family=RocknRoll+One&family=Noto+Sans+JP:wght@400;700&display=swap);

:root {
    /* Color palette */
    --offwhitecolor: #E3DCD2;
    --redcolor: #FF0000;
    --olivecolor: #788402;
    --orangecolor: #FEAA00;
    --purplecolor: #261C1E;
    --darkpurplecolor: #120C0D;
    --stormycolor: #494E6B;
    --cloudcolor: #98878F;
    --sunsetcolor: #98586D;
    --eveningcolor: #192231;
    
    /* Font declarations */
    --seriftitle: "Patua One";
    --scribbletitle: "Kaushan Script";
    --font-en: "Muli", Arial, Helvetica, sans-serif;
    --font-ja: "Noto Sans JP", Arial, Helvetica, sans-serif;
    --defaulttext: "Muli", "Noto Sans JP", Arial, Helvetica, sans-serif;
    --seriftitlejp: "RocknRoll One";
    
    /* Text colors */
    --textcolor: var(--offwhitecolor);
    --titlecolor: var(--orangecolor);
    --inlinelinkcolor: #EAC886;
    --titlevisitedcolor: #C17144;
    --titleshadowcolor: #805200;
}

html {
    background: var(--purplecolor);
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--defaulttext);
    color: var(--textcolor);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-size: 0.9em;
}

table {
    margin: 0 auto;
}

a {
    color: var(--sunsetcolor);
    text-decoration: none;
    text-decoration-skip-ink: auto;
}

a:hover {
    color: var(--cloudcolor);
}

/* Tighten spacing between paragraphs and lists */
p + ul {
    margin-top: -0.9em;
    margin-bottom: 0;
}

.titlename {
    font-family: var(--seriftitle);
    font-weight: normal;
    font-size: 1.2em;
    color: var(--titlecolor);
}

.titlenamejp {
    font-family: var(--seriftitlejp);
    font-weight: normal;
    font-size: 1.2em;
    color: var(--titlecolor);
    lang: jp;
}

.sitetitlename {
    font-family: var(--seriftitle);
    font-weight: normal;
    font-size: 1.2em;
}

.headerbar {
    background-image: url('images/headerbg.png');
    position: sticky;
    top: 0;
    z-index: 100;
    background-repeat: repeat-x;
    background-position: left bottom;
    background-size: auto 100%;
    height: 40px;
    min-height: 40px;
    margin: 0;
    border: none;
}

.header-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.header-left-group {
    display: flex;
    align-items: baseline;
    gap: 0.25em;
}

.divtitle {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin: 0;
}

.divtitletext {
    font-family: var(--seriftitle);
    font-weight: normal;
    flex-grow: 0;
    font-size: 1.3em;
}

.divtitletextjp {
    font-family: var(--seriftitlejp);
    font-weight: normal;
    flex-grow: 0;
    font-size: 1.3em;
    lang: jp;
}

.divider {
    flex-grow: 1;
    height: 1px;
    margin: 0 200px 12px 200px;
    background: repeating-linear-gradient(
        90deg,
        var(--cloudcolor) 0 2px,
        transparent 2px 4px
    );
}

.dividerright {
    flex-grow: 1;
    height: 1px;
    margin: 0 10px 0 3px;
    background-color: var(--cloudcolor);
}

.footerbar {
    background-image: url('images/headerbg.png');
    background-repeat: repeat-x;
    background-position: left bottom;
    transform: scaleY(-1);
    margin: 0;
    padding: 0;
}

.footer-inner {
    max-width: 800px;
    margin: 0 auto;
    transform: scaleY(-1);
    padding: 0 10px 10px 10px;
}

/* Mobile styles */
@media (max-width: 768px) {
    body {
        display: grid;
        grid-template-columns: 1fr;
    }
    
    .headerbar, .footerbar {
        grid-column: 1 / -1;
        width: 100vw;
        justify-self: center;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        position: static;
    }
    
    .header-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
        max-width: 800px;
        margin: 0 auto;
    }
    
    .header-left-group {
        flex-direction: row;
        align-items: baseline;
        gap: 0.5em;
    }
    
    /* Hide Japanese text on mobile to reduce clutter */
    .titlenamejp {
        display: none;
    }
    
    .titlename {
        font-size: 1.1em;
        line-height: 1.2;
    }
    
    .sitetitlename {
        font-size: 0.9em;
        color: var(--cloudcolor);
    }
    
    .header-inner .sitetitlename:last-child {
        font-size: 0.75em;
        text-align: right;
        word-break: break-word;
        max-width: 200px;
    }
    
    .divider {
        margin: 0 30px 12px 30px;
    }
    
    .divtitletext, .divtitletextjp {
        font-size: 1.2em;
    }
}

/* Small mobile screens */
@media (max-width: 480px) {
    .header-inner {
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
    }
    
    .header-left-group {
        align-items: center;
        flex-direction: row;
        gap: 0.5em;
    }
    
    .header-inner .sitetitlename:last-child {
        display: block;
        font-size: 0.7em;
        margin-top: 0.25rem;
        word-break: break-all;
    }
    
    .titlename {
        font-size: 1em;
    }
    
    .sitetitlename {
        font-size: 0.8em;
    }
    
    .divider {
        margin: 0 20px 8px 20px;
    }
}