html {
    --link-base: blue;
    --link-visited: #66f;
    --color1: darkgreen;
    --color2: red;
    --color3: #202020;
    --color4: brown;
    --color5: darkred;
    --color-gold: #fe6;
    --color-silver: #eef;
    --color-bronze: #eb5;
    --color-text: #000;
    --color-bg: #efefef;
    --color-bg2: #b6b6b6;
    --color-selected-bg: #fff;
    --color-selected-text: #000;
    font-size: 1rem;
    &.darkm {
        --link-base: #f64;
        --link-visited: orange;
        --color1: lime;
        --color2: skyblue;
        --color3: #cfcfcf;
        --color4: orange;
        --color5: pink;
        --color-gold: #60560b;
        --color-silver: #445;
        --color-bronze: #643;
        --color-text: #eee;
        --color-bg: #19191d;
        --color-bg2: #3a3a3a;
        --color-selected-bg: #000;
        --color-selected-text: #fff;
    }
    color: var(--color-text);
    /* text-shadow: 0 0 4px var(--color-bg), 0 0 2px var(--color-selected-text); */
}
#content-wrapper {
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    font-family: sans-serif;
    box-sizing: border-box;
}
#content-wrapper > *:not(#header) {
    padding-left: 20px;
    padding-right: 20px;
}

body {
    position: relative;
    background-color: #d5c4c7;
    margin: 0;
}
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100vh;
    z-index: -1;

    background-image: url('assets/TamaBackground.webp?v=2');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    
    background-color: rgba(255, 255, 255, 0.5);
    transition: background-color 0.3s ease;
    background-blend-mode: overlay;
    
    pointer-events: none;
}
.darkm body::before {
    background-color: rgba(0, 0, 0, 0.3); 
}



.header-controls {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    max-width: 1600px;
    font-size: 18px;
    padding: 2px 20px;
    box-sizing: border-box;
}
.header-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1200 / 337;
    background-color: transparent;
}
.layer {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.header-layers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.p1 {
    object-fit: contain;
    max-width: 30%;
    max-height: 48%;
    object-position: left top; 
    z-index: 4; 
}
.p2 { 
    object-fit: contain;
    object-position: center; 
    z-index: 3; 
}
.p3 {
    object-fit: cover;
    object-position: right center; 
    z-index: 2; 
}
.p4 { 
    width: 100%;
    object-fit: cover;
    object-position: center; 
    z-index: 1; 
}



.container, .inactive-page .inactive-message {
    display: block;
    text-align: center;
    &>div {
        margin: 0 20px;
        h3 { text-align: center; flex-wrap: nowrap;}
    }
}

.url:link{
    color: var(--link-base);
}
.url:visited, .url:hover, .url:active {
    color: var(--link-visited);
}
.icon-container {
    position: relative;
    display: inline-block;
    transition: 0.2s;
}

.check-mark {
    position: absolute !important;
    bottom: 0px !important;
    right: -5px !important;
    width: 30px !important;
    height: 30px !important;
    display: none;
    z-index: 10;
}

.selected .check-mark {
    display: block;
}

.link-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(calc(100% / 6 - 15px), 1fr));
    gap: 12px;
    padding: 10px 20px;
    box-sizing: border-box;
}
.link-title {
    font-weight: bold;
    font-size: clamp(1rem, 4vw, 2rem);
}
.link-grid-container a {
    text-decoration: none !important;
}
.link-grid-medicontainer a {
    text-decoration: none !important;
}
.link-grid-minicontainer a {
    text-decoration: none !important;
}
.link-button {
    position: relative;
    padding: 18px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
    border-radius: 8px;
}
.link-button-2 {
    position: relative;
    padding: 18px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
    border-radius: 8px;
}
.link-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    /* background: transparent; */
    z-index: -1;
    transition: background 0.3s ease;
    pointer-events: none;
}
.link-button .link-title {
    color: #333 !important;
    text-shadow: 0 0 8px rgb(255, 255, 255), 0 0 4px rgb(255, 255, 255);
}
#switch-dark, #switch-light {
    display: none !important;
}

html:not(.darkm) #switch-dark {
    display: inline-block !important;
}

html.darkm #switch-light {
    display: inline-block !important;
}
.darkm .link-button::before {
    background: rgba(0, 0, 0, 0.4);
}
.darkm .link-button .link-title {
    color: #fff !important;
    text-shadow: 0 0 8px rgba(0, 0, 0, 1), 0 0 4px rgba(0, 0, 0, 1);
}

.link-button:hover::before {
    background: rgba(255, 255, 255, 0.2);
}
.darkm .link-button:hover::before {
    background: rgba(0, 0, 0, 0.2);
}
.link-button.selected::before {
    background: transparent !important;
    opacity: 0 !important;
    pointer-events: none;
}
.link-button.selected {
    filter: brightness(1.2);
    transform: scale(1.02);
}
input[type="checkbox"] {
    accent-color: #3a3;
}
.link-grid-container .link-title {
    white-space: nowrap;
}
.link-grid-medicontainer .link-title {
    white-space: nowrap;
}
.link-grid-minicontainer .link-title {
    font-size: 1.5rem !important;
    white-space: nowrap;
}

@media screen and (max-width: 1024px) and (pointer: coarse) {
    #mobile {
        font-size: 1.7rem !important;/* font-size: 2.6em !important; */
    }
    #content-wrapper {
        padding: 0px;
    }
    div h2 {
        font-size: 2rem;
        line-height: 1.1 !important;
        min-width: auto !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    .header-container {
        max-height: 150px !important;
    }
    .header-controls {
        padding: 2px 20px;
        font-size: 1.6rem !important;
    }
    .link-grid-medicontainer {
        grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
    }
    .link-grid-container {
        grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    }
    .link-grid-minicontainer {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    .link-title {
        font-weight: bold;
        font-size: clamp(0.9rem, 5vw, 1.4rem) !important;
    }
}

/*PC*/
@media screen and (pointer: fine) {
    html {
        font-size: 0.875rem !important;
    }
    #mobile {
        font-size: 1.4rem !important;/* font-size: 2.1rem !important; */
    }
    
    control-field.xsizeup {
        flex-direction: column !important;
    }
    .header-img {
        height: 150px;
    }
    .header-container {
        min-width: 100%;
        max-height: 150px !important;
    }
}