:root {
    --color-text: #202122;
    --color-text-muted: #72777d;
    --color-link: #3366cc;

    --color-border: #a2a9b1;
    --color-border-light: #eaecf0;

    --color-background-light: #f8f9fa;

    --font-size-base: 16px;
    --font-size-small: 0.875rem;
    --font-size-xsmall: 0.8rem;

    --font-size-h1: 2rem;
    --font-size-h2: 1.5rem;
    --font-size-h3: 1.15rem;
}

/* PC */
.menu-toggle,
.mobile-menu {
    display: none;
}


body {
    margin: 0;
    font-family: "Noto Sans JP", sans-serif;
    font-size: var(--font-size-base);
    line-height: 1.4;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}


/* =========================
   Header
========================= */

#header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
}

.site-header {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    border-bottom: 1px solid var(--color-border);
}

.site-header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;

    color: var(--color-text);
    text-decoration: none;

    font-size: 20px;
    font-weight: bold;
}

.site-logo img {
    width: 32px;
    height: 32px;

    image-rendering: pixelated;
}


/* =========================
   Search Result
========================= */

.search-result-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border-light);
}

.search-result-title {
    color: var(--color-link);
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
}

.search-result-title:hover {
    text-decoration: underline;
}


/* =========================
   Navigation
========================= */

.site-nav {
    display: flex;
    gap: 40px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;

    position: relative;

    color: var(--color-text);
    text-decoration: none;
    transition:
        transform 0.18s ease,
        filter 0.18s ease;
}

.nav-item:hover {
    transform: scale(1.03);
}


.nav-item img {
    width: 32px;
    height: auto;

    image-rendering: pixelated;
}

.nav-icon-block {
    transform: scale(0.75);
}

.nav-text {
    display: flex;
    flex-direction: column;

    line-height: 1.1;
}

.nav-en {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.05em;

    margin-bottom: 1px;
}

.nav-ja {
    font-size: 11px;
    color: var(--color-text-muted);
}

.nav-item:hover .nav-en,
.nav-item:hover .nav-ja {
    color: var(--color-link);
}

.nav-separator {
    width: 1px;
    height: 25px;
    background: var(--color-border);
    flex-shrink: 0;
    transform: translateY(3px);
}


/* =========================
   Search
========================= */

.site-search {
    justify-self: end;

    display: flex;

    margin-left: 40px;
}

.site-search input {
    width: 300px;

    padding: 6px 8px;

    border: 1px solid var(--color-border);
}

.site-search button {
    padding: 6px 12px;

    border: 1px solid var(--color-border);
    border-left: none;

    background: var(--color-background-light);
}

.site-search input,
.site-search button {
    font-size: 14px;
    line-height: 1.2;
}


/* =========================
   Page Layout
========================= */

.page-layout {
    display: grid;
    grid-template-columns: 180px minmax(0, 900px);
    gap: 40px;

    max-width: 1200px;

    margin: 32px auto;
    padding: 0 24px;
}

.page-content {
    min-width: 0;
}

.page-content a {
    color: var(--color-link);
    text-decoration: none;
}

.page-content a:hover {
    text-decoration: underline;
}


/* =========================
   Left TOC
========================= */

.toc {
    position: sticky;
    top: 100px;

    align-self: start;

    display: flex;
    flex-direction: column;

    font-size: var(--font-size-small);
}

.toc-title {
    font-weight: bold;

    padding-bottom: 8px;
    margin-bottom: 8px;

    border-bottom: 1px solid var(--color-border);
}

.toc a {
    color: var(--color-link);
    text-decoration: none;
}

.toc a:hover {
    text-decoration: underline;
}

#toc-list {
    display: flex;
    flex-direction: column;

    gap: 4px;
}

#toc-list a {
    display: block;

    color: var(--color-link);
    text-decoration: none;
}

#toc-list a:hover {
    text-decoration: underline;
}

.toc-subitem {
    margin-left: 16px;
}


/* =========================
   In-page TOC Box
========================= */

.toc-box {
    width: fit-content;
    min-width: 240px;

    margin: 24px 0 32px;
    padding: 10px 20px 15px 15px;

    border: 1px solid var(--color-border);
    background: var(--color-background-light);

    font-size: var(--font-size-small);
}

.toc-box-title {
    font-weight: 600;
    text-align: center;

    margin-bottom: 10px;
}

#toc-box-list {
    display: flex;
    flex-direction: column;

    gap: 6px;
}

#toc-box-list a {
    color: var(--color-link);
    text-decoration: none;
}

#toc-box-list a:hover {
    text-decoration: underline;
}

#toc-box-list .toc-subitem {
    margin-left: 16px;
}

.toc-number {
    color: var(--color-text);
    margin-right: 10px;
}


/* =========================
   Updates
========================= */

.updates {
    margin-top: 32px;
}

.update-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 20px;

    padding: 12px 0;
}

.update-date {
    color: var(--color-text-muted);
    font-size: 14px;
}

.update-content p {
    margin: 4px 0 0;
}


/* =========================
   Environment Table
========================= */

.environment-table {
    font-size: 1rem;
}

.environment-table th,
.environment-table td {
    text-align: left;
    font-size: inherit;
}

.environment-table th {
    padding-right: 32px;
}


/* =========================
   Footer
========================= */

.site-footer {
    margin-top: 48px;

    border-top: 1px solid var(--color-border);
    background: var(--color-background-light);
}

.site-footer-inner {
    max-width: 1200px;

    margin: 0 auto;
    padding: 20px 24px;

    font-size: 13px;
    color: var(--color-text-muted);
}

.site-footer a {
    color: var(--color-link);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.footer-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    opacity: 0.7;

    transition:
        opacity 0.15s,
        transform 0.15s;
}

.footer-social-link:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.footer-social-link img {
    width: 36px;
    height: 36px;

    object-fit: contain;
}

.footer-copyright,
.footer-disclaimer {
    margin: 4px 0;
    font-size: 12px;
    color: var(--color-text-muted);
}


/* =========================
   External Link Icon
========================= */

.external-link::after {
    content: "";

    display: inline-block;

    width: 12px;
    height: 12px;

    margin-left: 4px;

    background-color: currentColor;

    mask: url("icons/external-link.svg") center / contain no-repeat;
    -webkit-mask: url("icons/external-link.svg") center / contain no-repeat;

    vertical-align: -1px;
}


/* =========================
   Form Elements
========================= */

button,
input,
select,
textarea {
    font: inherit;
}


/* =========================
   Item Grid
========================= */

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;

    margin-top: 20px;
}

.item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;

    padding: 16px;

    border: 1px solid var(--color-border-light);
    background: white;

    color: var(--color-link);
    text-decoration: none;
}

.item-card:hover {
    background: var(--color-background-light);
    border-color: var(--color-border);
}

.item-card img {
    width: 64px;
    height: 64px;

    object-fit: contain;
    image-rendering: pixelated;
}

.item-card span {
    text-align: center;
    font-size: 14px;
}


/* =========================
   Hero
========================= */

.hero {
    position: relative;

    min-height: 260px;

    padding: 48px;

    display: flex;
    align-items: center;

    background-image: url("images/top-background.png");
    background-size: cover;
    background-position: center;

    overflow: hidden;
}

.hero::before {
    content: "";

    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.35);
}

.hero-content {
    position: relative;
    z-index: 1;

    color: white;
}


/* =========================
   Info Box
========================= */

.article-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 32px;
    align-items: start;
}

.infobox {
    float: right;
    position: relative;
    z-index: 2;

    width: 280px;
    margin: 0 0 24px 32px;

    border: 1px solid var(--color-border);
    background: var(--color-background-light);

    box-shadow: -16px 0 0 white;

    font-size: var(--font-size-small);
}

.infobox-title {
    padding: 10px 12px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

.infobox-image {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: contain;
    margin: 20px auto;
    image-rendering: pixelated;
}

.infobox table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    box-sizing: border-box;
}

.infobox th,
.infobox td {
    padding: 7px 10px;
    border-top: 1px solid var(--color-border-light);
    text-align: left;
    vertical-align: top;
    box-sizing: border-box;
}

.infobox th {
    width: 120px;
    font-weight: 500;
    white-space: nowrap;
}

.infobox td {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.item-id {
    display: inline-block;
    padding: 3px 6px;

    background: var(--color-border-light);
    border-radius: 4px;

    font-size: 0.95em;
    font-family: "Roboto Mono", monospace;
    font-weight: 300;
    overflow-wrap: anywhere;
}

/* =========================
   Footnotes & References
========================= */
sup a {
    color: var(--color-link);
    text-decoration: none;
}

sup a:hover {
    text-decoration: underline;
}

.footnotes,
.references {
    font-size: var(--font-size-xsmall);
    line-height: 1.7;
    padding-left: 24px;
}

.footnotes li,
.references li {
    margin-bottom: 6px;
}

.reference-backs {
    margin-right: 4px;
}

.reference-back {
    margin-right: 4px;
    color: var(--color-link);
    text-decoration: none;
}

.reference-back:hover {
    text-decoration: underline;
}


/* =========================
   Food Points
========================= */

.food-points {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.food-points-icons {
    display: inline-flex;
    align-items: center;
    gap: 0;
    transform: translateY(1px);
}

.food-points-icons img {
    width: 16px;
    height: 16px;

    margin-right: -4px;
    image-rendering: pixelated;
}

.food-points-number {
    white-space: nowrap;
}


/* =========================
   Crafting Recipe
========================= */

.crafting-recipe {
    display: flex;
    align-items: center;
    gap: 20px;

    width: fit-content;

    padding: 20px;

    background: #c6c6c6;
    border: 2px solid #555;
    margin-bottom: 28px;
}

.crafting-grid {
    display: grid;
    grid-template-columns: repeat(3, 48px);
    grid-template-rows: repeat(3, 48px);
}

.crafting-slot {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;

    background: #8b8b8b;

    border-top: 2px solid #373737;
    border-left: 2px solid #373737;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;

    position: relative;
}

.crafting-slot img {
    width: 32px;
    height: 32px;

    object-fit: contain;
    image-rendering: pixelated;
}

.crafting-arrow {
    font-size: 32px;
    color: #404040;
}

.crafting-result-slot {
    width: 56px;
    height: 56px;
}

.crafting-result-slot img {
    width: 36px;
    height: 36px;
}

.item-count {
    position: absolute;

    right: 3px;
    bottom: 1px;

    color: white;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;

    text-shadow:
        -1px -1px 0 #3f3f3f,
        0   -1px 0 #3f3f3f,
        1px -1px 0 #3f3f3f,
        -1px  0   0 #3f3f3f,
        1px  0   0 #3f3f3f,
        -1px  1px 0 #3f3f3f,
        0    1px 0 #3f3f3f,
        1px  1px 0 #3f3f3f;
}

.item-tooltip {
    position: relative;
}

.item-tooltip::after {
    content: attr(data-name);

    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);

    padding: 5px 8px;

    background: rgba(20, 20, 20, 0.95);
    color: white;

    font-size: 13px;
    white-space: nowrap;

    border-radius: 3px;

    opacity: 0;
    pointer-events: none;

    transition: opacity 0.1s;

    z-index: 100;
}

.item-tooltip:hover::after {
    opacity: 1;
}


/* =========================
   表 - ポーション効果
========================= */

.effect-table {
    border-collapse: collapse;
    border: 1px solid var(--color-border);

    margin: 16px 0 28px;

    font-size: 1rem;
}

.effect-table th,
.effect-table td {
    padding: 10px 16px;

    border: 1px solid var(--color-border-light);

    text-align: left;
    vertical-align: middle;
}

.effect-table th {
    background: var(--color-background-light);
    font-weight: 500;
}

.effect {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    white-space: nowrap;
}

.effect img {
    width: 18px;
    height: 18px;

    object-fit: contain;
    image-rendering: pixelated;
}

.effect-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.effect-table th:last-child,
.effect-table td:last-child {
    white-space: nowrap;
    min-width: 72px;
}


/* =========================
   表 - 温度計
========================= */

.thermometer-table {
    border-collapse: collapse;
    border: 1px solid var(--color-border);

    margin: 16px 0 28px;

    font-size: 1rem;
}

.thermometer-table th,
.thermometer-table td {
    padding: 10px 16px;

    border: 1px solid var(--color-border-light);

    text-align: left;
    vertical-align: middle;
}

.thermometer-table th {
    background: var(--color-background-light);
    font-weight: 500;
}

.thermometer-table img {
    display: block;

    width: 48px;
    height: 48px;

    object-fit: contain;
    image-rendering: pixelated;
}


/* =========================
   表 - 製材台
========================= */

.woodcutter-table {
    border-collapse: collapse;
    border: 1px solid var(--color-border);

    margin: 16px 0 28px;

    font-size: 1rem;
}

.woodcutter-table th,
.woodcutter-table td {
    padding: 10px 16px;

    border: 1px solid var(--color-border-light);

    text-align: left;
    vertical-align: middle;
}

.woodcutter-table th {
    background: var(--color-background-light);
    font-weight: 500;
}

.woodcutter-table td:last-child {
    text-align: center;
    white-space: nowrap;
}


/* 木材ごとのチェスト 画像サイズ調整*/
.chest-table-image {
    display: block;

    width: 64px;
    height: 64px;

    margin: 0 auto;

    object-fit: contain;
    image-rendering: pixelated;
}


/* =========================
   ダウンロード
========================= */

.download-button,
.download-button:visited {
    display: inline-block;

    padding: 10px 18px;

    border: 1px solid var(--color-link);
    border-radius: 4px;

    background: var(--color-link);
    color: white !important;

    font-weight: 500;
    text-decoration: none !important;

    transition:
        filter 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.download-button:hover {
    color: white !important;
    text-decoration: none !important;

    filter: brightness(0.9);
    transform: translateY(3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.18);
}

.download-button-small {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.download-table th:last-child,
.download-table td:last-child {
    text-align: center;
}

/* =========================
   Headings
========================= */

h1,
h2 {
    scroll-margin-top: 100px;
}

h1 {
    font-weight: 500;
    font-size: var(--font-size-h1);
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 6px;

    border-bottom: 1px solid var(--color-border);
}

h2 {
    font-weight: 500;
    font-size: var(--font-size-h2);
    margin-top: 48px;
    margin-bottom: 10px;
    padding-bottom: 0px;

    border-bottom: none;
    position: relative;
}

h2::after {
    content: "";
    display: block;
    margin-top: 6px;

    border-bottom: 1px solid var(--color-border);
}

h3 {
    font-weight: 700;
    font-size: var(--font-size-h3);
    margin-top: 0px;
    margin-bottom: -10px;
}


/* =========================
   画像
========================= */

.article-image {
    width: fit-content;
    margin: 20px auto 28px;
    text-align: center;
}

.article-image img {
    display: block;
    width: 220px;
    max-width: 100%;
    height: auto;

    border: 1px solid var(--color-border);
    background: white;
}

.article-image figcaption {
    margin-top: 8px;
    font-size: 14px;
    color: #54595d;
}


/* =========================
   表
========================= */

.table-scroll {
    overflow-x: auto;
}

.table-scroll table {
    min-width: 720px;
}

/* =========================
   作物 - 成長段階
========================= */

.crop-stages {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;

    margin: 16px 0 24px;
}

.crop-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;

    padding: 10px;

    border: 1px solid var(--color-border-light);
    background: var(--color-background-light);
}

.crop-stage img {
    width: 64px;
    height: 64px;

    object-fit: contain;
    image-rendering: pixelated;
}

.crop-stage span {
    font-size: var(--font-size-small);
    color: var(--color-text-muted);
}

/* ============================ */
/*          Smartphone          */
/*       これは一番下に書く       */
/* ============================ */
@media (max-width: 700px) {

    .site-header {
    display: block;
    padding: 0;
    }

    .site-header-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;

        width: 100%;
        padding: 10px 16px;

        box-sizing: border-box;
    }

    /* PC用ナビと検索を隠す */
    .site-nav,
    .site-search {
        display: none;
    }

    /* ロゴ */
    .site-logo {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .site-logo img {
        width: 32px;
        height: 32px;
    }

    .site-logo span {
        font-size: 16px;
        font-weight: 600;
    }

    /* ハンバーガー */
    .menu-toggle {
        display: block;

        padding: 4px 8px;
        border: none;
        background: none;

        font-size: 28px;
        line-height: 1;

        cursor: pointer;
    }

    /* メニュー本体 */
    .mobile-menu {
        display: none;

        padding: 12px 16px 16px;
        border-top: 1px solid var(--color-border-light);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;

        background: white;
    }

    .mobile-menu.is-open {
        display: block;
    }

    .mobile-nav {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .mobile-nav a {
        display: flex;
        align-items: center;
        gap: 10px;

        padding: 10px 4px;

        color: var(--color-text);
        text-decoration: none;

        border-bottom: 1px solid var(--color-border-light);
    }

    .mobile-nav img {
        width: 28px;
        height: 28px;

        object-fit: contain;
        image-rendering: pixelated;

        flex-shrink: 0;
    }

    .mobile-nav-icon-small {
        transform: scale(0.75);
    }

    .mobile-nav a:hover {
        background: var(--color-background-light);
    }

    /* スマホ検索 */
    .mobile-search {
        display: flex;

        width: 100%;
        margin-top: 16px;

        box-sizing: border-box;
    }
    .mobile-search input {
        flex: 1;
        min-width: 0;
        padding: 8px;
        border: 1px solid var(--color-border);
        box-sizing: border-box;
    }

    .mobile-search button {
        flex-shrink: 0;
        padding: 8px 12px;

        border: 1px solid var(--color-border);
        border-left: none;

        background: var(--color-background-light);
        box-sizing: border-box;   
    }

    :root {
        --font-size-base: 14px;
        --font-size-h1: 1.75rem;
        --font-size-h2: 1.35rem;
        --font-size-h3: 1.1rem;
    }

    .environment-table {
        font-size: 1rem;
    }

    .toc {
        display: none;
    }

    .toc-box {
        margin: 24px auto 32px;
    }

    .page-layout {
        display: block;
        margin: 24px auto;
        padding: 0 16px;
    }

    .page-content {
        width: 100%;
    }

    .infobox {
        float: none;

        width: 280px;
        max-width: 100%;

        margin: 24px auto;

        box-shadow: none;
    }

    .footer-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .footer-social {
        gap: 14px;
    }

    .effect-table th,
    .effect-table td {
        padding: 8px 10px;
    }

    .effect-table th:last-child,
    .effect-table td:last-child {
        white-space: nowrap;
        min-width: 64px;
    }
    
}
