﻿/* ============================================================
   BASE
============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
    overflow-x: hidden;
}

:root {
    color-scheme: dark;
    --page-bg: #181a20;
    --page-text: #e6e8ee;
    --page-glow: radial-gradient(circle at top, #222530 0%, #181a20 65%);
    --layout-bg: #313338;
    --panel-bg: #2b2d31;
    --panel-strong-bg: #232428;
    --panel-muted-bg: #2f3136;
    --panel-hover-bg: #404249;
    --panel-focus-bg: #1a1c1f;
    --field-bg: #1f2125;
    --field-focus-bg: #1a1c20;
    --border-color: #1e1f22;
    --border-soft-color: #404249;
    --text-strong: #ffffff;
    --text-primary: #dbdee1;
    --text-secondary: #b5bac1;
    --text-muted: #8e9297;
    --overlay-soft: rgba(0, 0, 0, 0.55);
    --overlay-strong: rgba(0, 0, 0, 0.6);
    --topbar-mobile-bg: linear-gradient(180deg, rgba(49, 51, 56, 0.98), rgba(49, 51, 56, 0.92));
    --pagination-mobile-bg: linear-gradient(0deg, rgba(49, 51, 56, 0.98), rgba(49, 51, 56, 0.92));
    --modal-close-color: #ffffff;
    --link-color: #ffffff;
    --link-hover-color: #ffffff;
    --subtle-divider-color: rgba(181, 186, 193, 0.18);
    --accent-soft-color: #7cc6ff;
    --accent-soft-hover-color: #a5d9ff;
    --accent-soft-active-color: #d8eeff;
    --card-gradient: linear-gradient(135deg, #2b2d31, #232428);
    --card-border-color: #404249;
    --card-shadow-color: rgba(88, 101, 242, 0.25);
    --link-icon-bg: transparent;
}

html.theme-light {
    color-scheme: light;
    --page-bg: #f4f6fb;
    --page-text: #1f2937;
    --page-glow: radial-gradient(circle at top, #ffffff 0%, #e9eef8 68%);
    --layout-bg: #eef3fb;
    --panel-bg: #ffffff;
    --panel-strong-bg: #f8fafc;
    --panel-muted-bg: #f8fafc;
    --panel-hover-bg: #e2e8f0;
    --panel-focus-bg: #ffffff;
    --field-bg: #ffffff;
    --field-focus-bg: #ffffff;
    --border-color: rgba(148, 163, 184, 0.35);
    --border-soft-color: rgba(148, 163, 184, 0.35);
    --text-strong: #1f2937;
    --text-primary: #1f2937;
    --text-secondary: #64748b;
    --text-muted: #64748b;
    --overlay-soft: rgba(15, 23, 42, 0.35);
    --overlay-strong: rgba(15, 23, 42, 0.45);
    --topbar-mobile-bg: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(238, 243, 251, 0.92));
    --pagination-mobile-bg: linear-gradient(0deg, rgba(248, 250, 252, 0.98), rgba(238, 243, 251, 0.92));
    --modal-close-color: #1f2937;
    --link-color: #1f2937;
    --link-hover-color: #1f2937;
    --subtle-divider-color: rgba(148, 163, 184, 0.45);
    --accent-soft-color: #2563eb;
    --accent-soft-hover-color: #1d4ed8;
    --accent-soft-active-color: #1d4ed8;
    --card-gradient: linear-gradient(135deg, #ffffff, #f8fafc);
    --card-border-color: rgba(148, 163, 184, 0.35);
    --card-shadow-color: rgba(37, 99, 235, 0.16);
    --link-icon-bg: rgba(37, 99, 235, 0.08);
}

body {
    margin: 0;
    font-family: "Segoe UI", Inter, Arial, sans-serif;
    background: var(--page-bg);
    color: var(--page-text);
    font-size: 14px;
    cursor: url("../images/cursor/curbase.png"), auto;
}

body.sidebar-open {
    overflow: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--page-glow);
    z-index: -1;
}

a {
    color: var(--link-color);
    text-decoration: underline;
}

a:visited,
a:hover,
a:active {
    color: var(--link-hover-color);
}

button,
a,
.wiki-link {
    cursor: url("../images/cursor/curselect.png"), pointer;
}

input {
    cursor: url("../images/cursor/edit.png"), text;
}

textarea {
    cursor: url("../images/cursor/edit.png"), text;
}

/* ============================================================
   WIKI LAYOUT
============================================================ */

.wiki-layout {
    display: flex;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    background: var(--layout-bg);
}

.wiki-sidebar {
    width: 240px;
    background: var(--panel-bg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: var(--overlay-soft);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 20;
}

body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.sidebar-top {
    flex: 1;
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.gothante-header {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 20px;
}

.gothante-header a {
    text-decoration: none;
}

.wiki-group {
    margin-bottom: 20px;
}

.wiki-title {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.wiki-link {
    display: block;
    padding: 6px 8px;
    margin-top: 6px;
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
    font-size: 14px;
    transition: 0.15s ease;
    position: relative;
}

.wiki-sidebar .wiki-link,
.wiki-sidebar .wiki-link:visited,
.wiki-sidebar .wiki-link:hover,
.wiki-sidebar .wiki-link:active {
    color: var(--text-primary);
}

.wiki-link:hover,
.wiki-link.active {
    background: var(--panel-hover-bg);
}

.wiki-link.active {
    font-weight: 600;
}

.wiki-link.with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.link-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
    opacity: 0.9;
    transition: 0.15s ease;
    padding: 2px;
    background: var(--link-icon-bg);
}

.wiki-link:hover .link-icon {
    opacity: 1;
    transform: scale(1.1);
}


.wiki-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--layout-bg);
    min-width: 0;
    min-height: 0;
}

.wiki-header {
    min-height: 48px;
    height: 48px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 14px;
    gap: 5px;
    position: relative;
}

.detail-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding-left: 16px;
}

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border-soft-color);
    border-radius: 6px;
    background: var(--panel-bg);
    color: var(--text-primary);
    flex-shrink: 0;
}

.mobile-menu-btn:hover {
    background: var(--panel-hover-bg);
}

.mobile-fab {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 25;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.wiki-content {
    flex: 1;
    overflow: hidden;
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
}

body.details-view .wiki-content {
    overflow-y: auto;
}

body.details-view .wiki-header {
    height: auto;
    min-height: 48px;
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 8px;
}

.wiki-content h2 {
    margin-top: 0;
    color: var(--text-strong);
}

.wiki-content p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.page-notice {
    margin-bottom: 12px;
    padding: 11px 14px;
    border: 1px solid var(--border-soft-color);
    border-radius: 10px;
    background: color-mix(in srgb, var(--panel-strong-bg) 90%, transparent);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
}

.page-notice.is-success {
    border-color: rgba(127, 220, 160, 0.35);
    background: rgba(35, 62, 46, 0.7);
    color: #b7f0c8;
}

.page-notice.is-error {
    border-color: rgba(255, 158, 158, 0.35);
    background: rgba(67, 37, 37, 0.72);
    color: #ffc0c0;
}

.page-notice.is-warning {
    border-color: rgba(255, 211, 123, 0.35);
    background: rgba(72, 57, 28, 0.72);
    color: #ffe0a3;
}

.back-btn {
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.back-btn svg {
    color: var(--text-primary);
    transition: 0.2s ease;
}

.back-btn:hover svg {
    color: #5bb0ff;
    filter: drop-shadow(0 0 8px #5bb0ff);
}

.patch-date {
    font-size: 14px;
    font-weight: 600;
    font-style: normal;
    flex-shrink: 0;
}

.patch-date.tag-label {
    background: #5865f2;
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
}

.patch-date.date-label {
    background: color-mix(in srgb, var(--panel-bg) 72%, var(--panel-hover-bg));
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

.patch-date.date-label::before {
    content: "🕒 ";
    opacity: 0.7;
}

/* ============================================================
   SEARCH AND TABLES
============================================================ */

.top-bar {
    margin-bottom: 5px;
    position: relative;
    z-index: 4;
}

.top-bar input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 6px;
    border: none;
    background: var(--panel-bg);
    color: var(--text-primary);
    font-size: 14px;
}

.top-bar input:focus {
    outline: none;
    background: var(--panel-focus-bg);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table-container {
    background: var(--panel-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow-x: hidden;
    overflow-y: hidden;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

body.details-view .table-container {
    overflow: visible;
    flex: 0 0 auto;
}

.table-container thead {
    background: var(--panel-strong-bg);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 3;
}

.table-container tbody {
    flex: 0 0 auto;
    overflow: visible;
}

.table-container td a,
.table-container td a:visited,
.table-container td a:hover,
.table-container td a:active {
    color: inherit;
}

.table-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--panel-bg) 70%, transparent);
    backdrop-filter: blur(2px);
    z-index: 5;
    opacity: 0;
    transition: opacity 0.2s ease;
}

th {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--panel-strong-bg);
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

td a {
    color: inherit;
    text-decoration: none;
}

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

tbody tr:nth-child(even) {
    background: var(--panel-muted-bg);
}

tbody tr:hover {
    background: var(--panel-hover-bg);
    transition: background 0.12s ease;
}

th.filterable {
    cursor: pointer;
    position: relative;
    transition: 0.2s ease;
}

th.filterable:hover {
    background: #2c3140;
}

th.filterable[aria-sort="ascending"],
th.filterable[aria-sort="descending"] {
    color: #ffffff;
    background: #353b4b;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

body.theme-light th.filterable[aria-sort="ascending"],
body.theme-light th.filterable[aria-sort="descending"] {
    color: #0f172a;
    background: #dbe7f7;
    box-shadow: inset 0 -1px 0 rgba(37, 99, 235, 0.12);
}

body.theme-light th.filterable:hover {
    background: #e7eef9;
}

body.theme-light .table-container thead,
body.theme-light th {
    background: #f8fafc;
}

.table-container tbody::-webkit-scrollbar {
    width: 8px;
}

.table-container tbody::-webkit-scrollbar-thumb {
    background: #3a3f4d;
    border-radius: 10px;
}

#wikiTable {
    width: 100%;
    table-layout: fixed;
}

#wikiTable th:nth-child(1),
#wikiTable td:nth-child(1) {
    width: 30%;
}

#wikiTable th:nth-child(2),
#wikiTable td:nth-child(2) {
    width: 40%;
}

#wikiTable th:nth-child(3),
#wikiTable td:nth-child(3) {
    width: 30%;
}

#wikiTable td a {
    display: block;
    width: 100%;
}

#wikiTable td a,
#wikiTable td a.no-hover,
#wikiTable td a.hover-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pagination {
    padding: 15px 0 5px;
    text-align: center;
    position: relative;
    z-index: 4;
}

.pagination button {
    background: var(--panel-bg);
    border: none;
    color: var(--text-primary);
    padding: 6px 10px;
    margin: 0 4px;
    border-radius: 4px;
    cursor: pointer;
}

.pagination button:hover {
    background: var(--panel-hover-bg);
}

.pagination button.active {
    background: #5865f2;
    color: white;
}

.pagination button:disabled {
    opacity: 0.45;
    cursor: default;
}

.pagination button:disabled:hover {
    background: var(--panel-bg);
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    margin: 0 4px;
    padding: 6px 2px;
}

.costume-gallery-container {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px;
}

.costume-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 22px;
    align-content: start;
}

.costume-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    min-height: 100%;
    padding: 18px;
    border: 1px solid var(--card-border-color);
    border-radius: 14px;
    background: var(--card-gradient);
    box-shadow: 0 10px 24px -20px var(--card-shadow-color);
    cursor: default;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.costume-card.is-previewable {
    cursor: pointer;
}

.costume-card.is-previewable:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent-soft-color) 36%, var(--card-border-color));
    box-shadow: 0 18px 30px -24px var(--card-shadow-color);
}

.costume-card.is-previewable:focus-visible {
    outline: 2px solid var(--accent-soft-color);
    outline-offset: 3px;
}

.costume-card.is-disabled {
    cursor: default;
}

.costume-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.costume-card-title,
.costume-card-title:visited,
.costume-card-title:hover,
.costume-card-title:active {
    color: var(--text-strong);
    text-decoration: none;
}

.costume-card-title {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.costume-card-date {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.costume-card-image-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.costume-card-image-frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 5 / 4;
    border-radius: 12px;
    background: color-mix(in srgb, var(--panel-strong-bg) 92%, transparent);
    border: 1px solid var(--border-soft-color);
}

.costume-card-image-frame.is-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
}

.costume-card-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.costume-card-image-placeholder {
    padding: 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.costume-card-description {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.65;
    white-space: normal;
}

.costume-gallery-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    padding: 24px;
    border: 1px dashed var(--border-soft-color);
    border-radius: 14px;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================================
   SHOP CALCULATOR
============================================================ */

.shop-calculator-content {
    gap: 12px;
    overflow-y: auto;
}

.shop-calculator-sticky {
    position: sticky;
    top: 0;
    z-index: 12;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 2px;
    background: var(--layout-bg);
}

.shop-calculator-sticky::before {
    content: "";
    position: absolute;
    top: -24px;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    background: var(--layout-bg);
    pointer-events: none;
}

.shop-calculator-status {
    color: var(--text-secondary);
    font-size: 13px;
}

.shop-calculator-status.is-error {
    color: #ff9e9e;
}

.shop-calculator-total {
    color: var(--text-strong);
    font-size: 14px;
    white-space: nowrap;
}

.shop-calculator-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    justify-content: flex-end;
}

.shop-calculator-toolbar {
    position: static;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto auto auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    z-index: auto;
}

.shop-calculator-toolbar button.suggest-edit-button {
    height: 38px;
    min-width: 92px;
}

.shop-calculator-toolbar button.shop-calculator-icon-button {
    min-width: 34px !important;
    width: 34px;
    padding: 0 !important;
    border-radius: 50%;
    font-weight: 700;
}

.shop-calculator-toolbar button.shop-calculator-secondary-button,
.shop-calculator-toolbar button.shop-calculator-icon-button {
    background: #5865f2;
    color: #ffffff;
}

.shop-calculator-toolbar button.shop-calculator-secondary-button:hover:not(:disabled),
.shop-calculator-toolbar button.shop-calculator-icon-button:hover:not(:disabled) {
    background: #4752c4;
}

.shop-calculator-toolbar button.shop-calculator-secondary-button:active:not(:disabled),
.shop-calculator-toolbar button.shop-calculator-icon-button:active:not(:disabled) {
    background: #3c45a5;
}

.shop-calculator-toolbar button.shop-calculator-danger-button,
body.theme-light .shop-calculator-toolbar button.shop-calculator-danger-button {
    background: #dc2626;
    color: #ffffff;
}

.shop-calculator-toolbar button.shop-calculator-danger-button:hover:not(:disabled),
body.theme-light .shop-calculator-toolbar button.shop-calculator-danger-button:hover:not(:disabled) {
    background: #b91c1c;
}

.shop-calculator-toolbar button.shop-calculator-danger-button:active:not(:disabled),
body.theme-light .shop-calculator-toolbar button.shop-calculator-danger-button:active:not(:disabled) {
    background: #991b1b;
}

.shop-calculator-table-container {
    overflow-x: auto;
    overflow-y: visible;
    flex: 0 0 auto;
}

.shop-calculator-table {
    table-layout: fixed;
    min-width: 680px;
}

.shop-calculator-table th {
    position: static;
    z-index: auto;
}

.shop-calculator-table td:nth-child(2),
.shop-calculator-table td:nth-child(4) {
    font-variant-numeric: tabular-nums;
}

.shop-calculator-table td:nth-child(3) {
    overflow: visible;
}

.shop-calculator-table input[type="number"] {
    width: 88px;
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-soft-color);
    border-radius: 6px;
    background: var(--field-bg);
    color: var(--text-primary);
    font: inherit;
    font-variant-numeric: tabular-nums;
}

.shop-calculator-table input[type="number"]:focus {
    outline: none;
    border-color: #5bb0ff;
    box-shadow: 0 0 0 3px rgba(91, 176, 255, 0.15);
    background: var(--field-focus-bg);
}

body.theme-light .shop-calculator-status.is-error {
    color: #b91c1c;
}

body.theme-light .shop-calculator-table input[type="number"] {
    background: #ffffff;
    color: #1f2937;
    border-color: rgba(148, 163, 184, 0.45);
}

body.theme-light .shop-calculator-table input[type="number"]:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* ============================================================
   FC TO PENYA CALCULATOR
============================================================ */

.fc-penya-content {
    gap: 16px;
    overflow-y: auto;
}

.fc-penya-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--panel-bg);
}

.fc-penya-header h1 {
    margin: 0;
    color: var(--text-strong);
    font-size: 26px;
    line-height: 1.2;
}

.fc-penya-header p {
    max-width: 720px;
    margin: 8px 0 0;
}

.fc-penya-kicker {
    margin: 0 0 6px !important;
    color: var(--text-muted) !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.fc-penya-clear-button {
    flex-shrink: 0;
}

.fc-penya-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.fc-penya-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--panel-bg);
}

.fc-penya-field span,
.fc-penya-scale-panel > span,
.fc-penya-result-card span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.45px;
    text-transform: uppercase;
}

.fc-penya-field input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border-soft-color);
    border-radius: 6px;
    background: var(--field-bg);
    color: var(--text-primary);
    padding: 10px 12px;
    font: inherit;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.fc-penya-field input:focus {
    outline: none;
    border-color: #5bb0ff;
    box-shadow: 0 0 0 3px rgba(91, 176, 255, 0.15);
    background: var(--field-focus-bg);
}

.fc-penya-scale-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--panel-bg);
}

.fc-penya-scale-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.fc-penya-scale-buttons button {
    min-width: 58px;
    border: 1px solid var(--border-soft-color);
    border-radius: 6px;
    background: var(--panel-strong-bg);
    color: var(--text-primary);
    padding: 8px 10px;
    font: inherit;
    font-weight: 700;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.fc-penya-scale-buttons button:hover {
    border-color: #5865f2;
    background: var(--panel-hover-bg);
}

.fc-penya-scale-buttons button:active {
    transform: translateY(1px);
}

.fc-penya-status {
    margin: 0;
}

.fc-penya-results {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.fc-penya-result-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--panel-bg);
}

.fc-penya-result-card strong {
    display: block;
    margin-top: 12px;
    color: var(--text-strong);
    font-size: 24px;
    line-height: 1.25;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.fc-penya-result-card small {
    display: block;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

body.theme-light .fc-penya-header,
body.theme-light .fc-penya-field,
body.theme-light .fc-penya-scale-panel,
body.theme-light .fc-penya-result-card {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.35);
}

body.theme-light .fc-penya-field input {
    background: #ffffff;
    color: #1f2937;
    border-color: rgba(148, 163, 184, 0.45);
}

body.theme-light .fc-penya-field input:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

body.theme-light .fc-penya-scale-buttons button {
    background: #f8fafc;
    color: #1f2937;
    border-color: rgba(148, 163, 184, 0.45);
}

body.theme-light .fc-penya-scale-buttons button:hover {
    background: #e2e8f0;
    border-color: #2563eb;
}

.shop-receipt-modal {
    padding: 18px;
}

.shop-receipt-panel {
    width: min(720px, 100%);
    max-height: min(760px, 88vh);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-soft-color);
    border-radius: 10px;
    background: var(--panel-bg);
    color: var(--text-primary);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
    overflow: hidden;
}

.shop-info-panel {
    width: min(420px, 100%);
}

.shop-receipt-header,
.shop-receipt-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: var(--panel-strong-bg);
}

.shop-receipt-header {
    border-bottom: 1px solid var(--border-color);
}

.shop-receipt-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-strong);
}

.shop-receipt-close {
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 24px;
    line-height: 1;
    padding: 0 4px;
}

.shop-receipt-body {
    overflow-y: auto;
    padding: 8px 0;
}

.shop-receipt-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 14px;
    align-items: center;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-color);
}

.shop-receipt-row:last-child {
    border-bottom: 0;
}

.shop-receipt-item-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shop-receipt-item-meta {
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
}

.shop-receipt-item-amount,
.shop-receipt-footer strong {
    color: var(--text-strong);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.shop-receipt-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
}

.shop-receipt-empty {
    padding: 34px 18px;
    color: var(--text-muted);
    text-align: center;
}

.shop-info-body {
    display: flex;
    flex-direction: column;
    padding: 4px 0;
}

.shop-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.shop-info-row:last-child {
    border-bottom: 0;
}

.shop-info-row span {
    color: var(--text-secondary);
}

.shop-info-row strong {
    color: var(--text-strong);
    text-align: right;
}

.shop-info-note {
    margin: 0;
    padding: 14px 16px;
    color: var(--text-secondary);
    line-height: 1.5;
    border-top: 1px solid var(--border-color);
}

body.theme-light .shop-calculator-toolbar button.shop-calculator-secondary-button,
body.theme-light .shop-calculator-toolbar button.shop-calculator-icon-button {
    background: #2563eb;
    color: #ffffff;
}

body.theme-light .shop-calculator-toolbar button.shop-calculator-secondary-button:hover:not(:disabled),
body.theme-light .shop-calculator-toolbar button.shop-calculator-icon-button:hover:not(:disabled) {
    background: #1d4ed8;
}

body.theme-light .shop-receipt-panel {
    background: #ffffff;
    color: #1f2937;
    border-color: rgba(148, 163, 184, 0.35);
}

body.theme-light .shop-receipt-header,
body.theme-light .shop-receipt-footer {
    background: #f8fafc;
}

/* ============================================================
   WIKI DETAILS
============================================================ */

.wiki-page {
    position: relative;
    padding: 20px;
    line-height: 1.6;
    font-size: 15px;
    text-align: justify;
}

.wiki-page p {
    margin-bottom: 12px;
}

.wiki-page-tools {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 6;
}

.wiki-page-tools[hidden] {
    display: none !important;
}

.wiki-page.is-editing #answerContent {
    display: none;
}

.wiki-page.is-editing .details-layout {
    display: none;
}

.details-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 24px;
    align-items: start;
}

.details-layout.details-layout-single-column {
    grid-template-columns: minmax(0, 1fr);
}

.details-main-column {
    min-width: 0;
}

.details-text-links {
    position: sticky;
    top: 20px;
    align-self: start;
}

.details-text-links-card {
    padding: 4px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.details-text-links-title {
    display: block;
    margin-bottom: 16px;
    color: #f2eee3;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.details-text-links-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.details-text-link,
.details-text-link:visited,
.details-text-link:active {
    display: block;
    padding: 6px 2px;
    border-radius: 0;
    color: #b8b2a5;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
    text-decoration: none;
    transition: color 0.18s ease;
}

.details-text-link.active,
.details-text-link.active:visited {
    color: #f2eee3;
}

.details-text-link:hover,
.details-text-link:active {
    color: #f2eee3;
    background: transparent;
}

.details-text-link.is-source-link,
.details-text-link.is-source-link:visited,
.details-text-link.is-source-link:active {
    font-weight: 700;
}

.wiki-section-heading {
    margin: 0;
    font: inherit;
    line-height: inherit;
    scroll-margin-top: 20px;
}

.details-target-highlight {
    border-radius: 8px;
    animation: detailsTargetHighlight 1.8s ease-out;
}

@keyframes detailsTargetHighlight {
    0% {
        background: rgba(242, 238, 227, 0.24);
        box-shadow: 0 0 0 0 rgba(242, 238, 227, 0.16);
    }
    35% {
        background: rgba(242, 238, 227, 0.16);
        box-shadow: 0 0 0 10px rgba(242, 238, 227, 0.08);
    }
    100% {
        background: transparent;
        box-shadow: 0 0 0 14px rgba(242, 238, 227, 0);
    }
}

.wiki-image {
    margin: auto;
    max-width: 600px;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    vertical-align: bottom;
    cursor: pointer;
    transition: 0.2s;
}

.wiki-image:hover {
    transform: scale(1.03);
}

.wiki-inline {
    display: inline-block;
    width: auto;
    height: 1em;
    vertical-align: middle;
    margin: 0 4px;
    border-radius: 0;
    transform: none !important;
}

.wiki-image-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
    align-items: center;
}

.faq-source-footer,
.similar-searches {
    margin-top: 20px;
    padding: 14px 0 0;
    border-top: 1px solid var(--subtle-divider-color);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}


.similar-searches {
    margin-top: 18px;
    margin-bottom: 8px;
}

.faq-source-footer a,
.similar-searches a {
    color: var(--link-color);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.faq-source-footer a:hover,
.similar-searches a:hover {
    color: var(--link-hover-color);
}

.suggest-edit-card {
    margin-top: 0;
    padding: 18px 18px 20px;
    border: 1px solid color-mix(in srgb, var(--accent-soft-color) 20%, transparent);
    border-radius: 16px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--accent-soft-color) 8%, transparent), transparent 52%),
        linear-gradient(180deg, var(--panel-bg) 0%, color-mix(in srgb, var(--panel-bg) 70%, var(--panel-strong-bg)) 100%);
    box-shadow: 0 20px 34px rgba(0, 0, 0, 0.22);
    text-align: left;
}

.suggest-edit-toggle {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--accent-soft-color);
    font: inherit;
    font-weight: 600;
    text-underline-offset: 3px;
}

.wiki-page-tools.is-expanded .suggest-edit-toggle {
    color: var(--accent-soft-active-color);
}

.suggest-edit-toggle:hover {
    color: var(--accent-soft-hover-color);
}

.suggest-edit-toggle:focus-visible {
    outline: 2px solid #5bb0ff;
    outline-offset: 4px;
    border-radius: 4px;
}

.suggest-edit-copy {
    margin-bottom: 16px;
}

.suggest-edit-card h4 {
    margin: 0 0 6px;
    font-size: 18px;
    color: var(--text-strong);
}

.suggest-edit-text {
    margin: 0;
    color: var(--text-secondary);
}

.suggest-edit-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.suggest-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.suggest-edit-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.suggest-edit-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.suggest-edit-field label span {
    color: var(--text-muted);
    font-weight: 400;
}

.suggest-edit-field input,
.suggest-edit-field textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--field-bg);
    color: var(--page-text);
    padding: 12px 13px;
    font: inherit;
    resize: vertical;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.suggest-edit-editor-field textarea {
    min-height: 360px;
    font-family: Consolas, "Courier New", monospace;
    line-height: 1.65;
    tab-size: 4;
}

.suggest-edit-field input:focus,
.suggest-edit-field textarea:focus {
    outline: none;
    border-color: #5bb0ff;
    box-shadow: 0 0 0 3px rgba(91, 176, 255, 0.15);
    background: var(--field-focus-bg);
}

.suggest-edit-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.suggest-edit-turnstile {
    max-width: 420px;
    width: 100%;
}

.suggest-edit-button {
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    background: #5865f2;
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    box-shadow: none;
    transition: background 0.15s ease, transform 0.05s ease;
}

.suggest-edit-button:hover:not(:disabled) {
    background: #4752c4;
}

.suggest-edit-button:active:not(:disabled) {
    background: #3c45a5;
    transform: translateY(1px);
}

.suggest-edit-button:disabled {
    background: #4e5058;
    color: #a3a6ad;
    cursor: not-allowed;
}

.suggest-edit-status {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.suggest-edit-status.is-success {
    color: #7fdca0;
}

.suggest-edit-status.is-error {
    color: #ff9e9e;
}

.suggest-edit-status.is-warning {
    color: #ffd37b;
}

.suggest-edit-honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* ============================================================
   MODALS
============================================================ */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-strong);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 28px;
    cursor: pointer;
    color: var(--modal-close-color);
}

.modal-image {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}


/* ============================================================
   SETTINGS PAGE
============================================================ */

.settings-container {
    height: 100%;
}

.settings-panel {
    flex: 1;
    background: var(--panel-bg);
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
}

.settings-section h2 {
    margin: 0 0 5px;
    font-size: 18px;
    color: var(--text-strong);
}

.settings-section h3 {
    margin: 0 0 12px;
    font-size: 15px;
    color: var(--text-strong);
}

.settings-section p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--panel-strong-bg);
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.15s ease;
}

.settings-group label:hover {
    background: var(--panel-hover-bg);
}

.settings-group input[type="checkbox"] {
    accent-color: #5865f2;
}

.settings-group input[type="radio"] {
    accent-color: #5865f2;
}

.search-highlight {
    background: rgba(255, 211, 123, 0.28);
    color: #fff1c2;
    padding: 0 2px;
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px rgba(255, 211, 123, 0.18);
}

body.theme-light {
    background: #f4f6fb;
    color: #1f2937;
}

body.theme-light::before {
    background: radial-gradient(circle at top, #ffffff 0%, #e9eef8 68%);
}

body.theme-light .wiki-layout,
body.theme-light .wiki-main {
    background: #eef3fb;
}

body.theme-light .wiki-sidebar,
body.theme-light .settings-panel,
body.theme-light .table-container,
body.theme-light .top-bar input,
body.theme-light .mobile-menu-btn,
body.theme-light .suggest-edit-card,
body.theme-light .settings-group label,
body.theme-light .pagination button,
body.theme-light .patch-date.date-label {
    background: #ffffff;
    color: #1f2937;
    border-color: rgba(148, 163, 184, 0.35);
}

body.theme-light .wiki-header,
body.theme-light .table-container thead {
    background: #f8fafc;
    border-color: rgba(148, 163, 184, 0.35);
}

body.theme-light .wiki-link,
body.theme-light a,
body.theme-light a:visited,
body.theme-light a:hover,
body.theme-light a:active,
body.theme-light td,
body.theme-light th,
body.theme-light .settings-section h2,
body.theme-light .settings-section h3,
body.theme-light .wiki-content h2,
body.theme-light .patch-date,
body.theme-light .gothante-header a,
body.theme-light .back-btn,
body.theme-light .back-btn svg,
body.theme-light .suggest-edit-field label,
body.theme-light .suggest-edit-card h4,
body.theme-light .table-container td a,
body.theme-light .table-container td a:visited,
body.theme-light .table-container td a:hover,
body.theme-light .table-container td a:active {
    color: #1f2937;
}

body.theme-light .wiki-sidebar .wiki-link,
body.theme-light .wiki-sidebar .wiki-link:visited,
body.theme-light .wiki-sidebar .wiki-link:hover,
body.theme-light .wiki-sidebar .wiki-link:active {
    color: #1f2937;
}

body.theme-light .wiki-title,
body.theme-light .wiki-content p,
body.theme-light .settings-section p,
body.theme-light .suggest-edit-text,
body.theme-light .suggest-edit-status,
body.theme-light .faq-source-footer,
body.theme-light .similar-searches,
body.theme-light .credit-card span,
body.theme-light th {
    color: #64748b;
}

body.theme-light .faq-source-footer,
body.theme-light .similar-searches {
    border-top-color: rgba(148, 163, 184, 0.45);
}

body.theme-light .faq-source-footer a,
body.theme-light .similar-searches a {
    color: #1d4ed8;
}

body.theme-light .faq-source-footer a:hover,
body.theme-light .similar-searches a:hover {
    color: #1e3a8a;
}

body.theme-light .details-text-links-card {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

body.theme-light .details-text-links-title {
    color: #111827;
}

body.theme-light .details-text-links-list {
    border-left-color: rgba(17, 24, 39, 0.12);
}

body.theme-light .details-text-link,
body.theme-light .details-text-link:visited {
    color: #4b5563;
}

body.theme-light .details-text-link.active,
body.theme-light .details-text-link.active:visited {
    color: #111827;
}

body.theme-light .details-text-link:hover,
body.theme-light .details-text-link:active {
    color: #111827;
    background: transparent;
}

body.theme-light .wiki-link:hover,
body.theme-light .wiki-link.active,
body.theme-light .settings-group label:hover,
body.theme-light tbody tr:hover,
body.theme-light .pagination button:hover,
body.theme-light .mobile-menu-btn:hover {
    background: #e2e8f0;
}

body.theme-light tbody tr:nth-child(even) {
    background: #f8fafc;
}

body.theme-light .pagination button.active {
    background: #2563eb;
    color: #ffffff;
}

body.theme-light .details-target-highlight {
    animation-name: detailsTargetHighlightLight;
}

@keyframes detailsTargetHighlightLight {
    0% {
        background: rgba(37, 99, 235, 0.14);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.1);
    }
    35% {
        background: rgba(37, 99, 235, 0.1);
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0.08);
    }
    100% {
        background: transparent;
        box-shadow: 0 0 0 14px rgba(37, 99, 235, 0);
    }
}

body.theme-light .patch-date.tag-label,
body.theme-light .suggest-edit-button {
    background: #2563eb;
    color: #ffffff;
}

body.theme-light .suggest-edit-button:hover:not(:disabled) {
    background: #1d4ed8;
}

body.theme-light .suggest-edit-button:active:not(:disabled) {
    background: #1e40af;
}

body.theme-light .suggest-edit-button:disabled {
    background: #cbd5e1;
    color: #64748b;
}

body.theme-light .suggest-edit-toggle {
    color: #2563eb;
}

body.theme-light .wiki-page-tools.is-expanded .suggest-edit-toggle,
body.theme-light .suggest-edit-toggle:hover {
    color: #1d4ed8;
}

body.theme-light .suggest-edit-toggle:focus-visible {
    outline-color: #2563eb;
}

body.theme-light .link-icon {
    opacity: 1;
    background: rgba(37, 99, 235, 0.08);
}

body.theme-light .top-bar input::placeholder,
body.theme-light .suggest-edit-field input::placeholder,
body.theme-light .suggest-edit-field textarea::placeholder {
    color: #94a3b8;
}

body.theme-light .top-bar input:focus,
body.theme-light .suggest-edit-field input,
body.theme-light .suggest-edit-field textarea {
    background: #ffffff;
    color: #1f2937;
    border-color: rgba(148, 163, 184, 0.45);
}

body.theme-light .table-container tbody::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

body.theme-light .suggest-edit-field input:focus,
body.theme-light .suggest-edit-field textarea:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

body.theme-light .table-loader {
    background: rgba(255, 255, 255, 0.78);
    color: #475569;
}

body.theme-light .page-notice {
    background: rgba(255, 255, 255, 0.95);
    color: #334155;
    border-color: rgba(148, 163, 184, 0.35);
}

body.theme-light .page-notice.is-success {
    background: rgba(221, 245, 230, 0.95);
    color: #166534;
}

body.theme-light .page-notice.is-error {
    background: rgba(254, 226, 226, 0.95);
    color: #b91c1c;
}

body.theme-light .page-notice.is-warning {
    background: rgba(254, 243, 199, 0.95);
    color: #92400e;
}

body.theme-light .sidebar-backdrop {
    background: rgba(15, 23, 42, 0.35);
}

body.theme-light .modal {
    background: rgba(15, 23, 42, 0.45);
}

body.theme-light .search-highlight {
    background: rgba(250, 204, 21, 0.32);
    color: #854d0e;
    box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.18);
}

body.theme-light .credit-card {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-color: rgba(148, 163, 184, 0.35);
    color: #1f2937;
    box-shadow: 0 12px 24px rgba(148, 163, 184, 0.12);
}

body.theme-light .credit-card:hover {
    border-color: #2563eb;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.16);
}

body.theme-light .credit-card::before {
    background: linear-gradient(120deg, transparent, rgba(37, 99, 235, 0.14), transparent);
}

body.theme-light .patch-date.date-label::before {
    opacity: 0.5;
}

/* ============================================================
   ABOUT PAGE
============================================================ */

.credits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-top: 15px;
}

.credit-card {
    background: var(--card-gradient);
    border: 1px solid var(--card-border-color);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    font-weight: 600;
    color: var(--text-strong);
    letter-spacing: 0.3px;
    transition: 0.2s ease;
    position: relative;
}

.credit-card span {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 400;
}

.credit-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: linear-gradient(120deg, transparent, rgba(88,101,242,0.2), transparent);
    opacity: 0;
    transition: 0.2s ease;
}

.credit-card:hover {
    transform: translateY(-4px);
    border-color: #5865f2;
    box-shadow: 0 6px 18px var(--card-shadow-color);
}

.credit-card:hover::before {
    opacity: 1;
}

/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 768px) {
    .wiki-layout {
        min-height: 100dvh;
    }

    .wiki-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(82vw, 280px);
        height: 100dvh;
        z-index: 30;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: 12px 0 28px rgba(0, 0, 0, 0.35);
    }

    body.sidebar-open .wiki-sidebar {
        transform: translateX(0);
    }

    .wiki-main {
        width: 100%;
        min-height: 100dvh;
        height: 100dvh;
    }

    .wiki-header {
        height: auto;
        min-height: 48px;
        padding: 12px 14px;
        padding-right: 14px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .mobile-menu-btn {
        display: inline-flex;
    }

    .wiki-content {
        padding: 14px;
        min-height: 0;
        height: 100%;
        overflow: hidden;
        gap: 10px;
    }

    body.details-view .wiki-content {
        overflow-y: auto;
    }

    .top-bar {
        position: sticky;
        top: 0;
        margin: 0 -14px;
        padding: 10px 14px 8px 62px;
        background: var(--topbar-mobile-bg);
        backdrop-filter: blur(8px);
    }

    .top-bar input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .shop-calculator-content {
        gap: 10px;
    }

    .shop-calculator-sticky {
        gap: 10px;
        margin: 0 -14px;
        padding: 0 14px 8px;
        background: var(--topbar-mobile-bg);
        backdrop-filter: blur(8px);
    }

    .shop-calculator-sticky::before {
        top: -18px;
        background: var(--topbar-mobile-bg);
    }

    .shop-calculator-toolbar {
        grid-template-columns: minmax(0, 1fr) auto auto auto;
        margin: 0;
        padding: 0;
        background: transparent;
        backdrop-filter: none;
    }

    .shop-calculator-summary {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: space-between;
    }

    .shop-calculator-toolbar .suggest-edit-button {
        grid-row: 1;
    }

    .shop-calculator-toolbar .suggest-edit-button {
        min-width: 84px;
        padding: 0 10px;
    }

    .shop-receipt-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px 12px;
    }

    .shop-receipt-item-meta {
        grid-column: 1;
        grid-row: 2;
    }

    .shop-receipt-item-amount {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .fc-penya-content {
        gap: 10px;
    }

    .fc-penya-header {
        flex-direction: column;
        padding: 16px;
    }

    .fc-penya-header h1 {
        font-size: 22px;
    }

    .fc-penya-clear-button {
        width: 100%;
    }

    .fc-penya-grid,
    .fc-penya-results {
        grid-template-columns: 1fr;
    }

    .fc-penya-scale-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .fc-penya-scale-buttons {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .fc-penya-scale-buttons button {
        min-width: 0;
        padding: 9px 6px;
    }

    th, td {
        padding: 10px 12px;
        font-size: 12px;
    }

    .pagination button {
        padding: 6px 10px;
        font-size: 12px;
        margin: 0 4px;
    }

    .table-container {
        overflow-x: auto;
        overflow-y: hidden;
        flex: 1;
        min-height: 0;
    }

    body.details-view .table-container {
        overflow: visible;
        flex: 0 0 auto;
    }

    .table-container table {
        min-width: 700px;
    }

    .costume-gallery-container {
        overflow-x: hidden;
        overflow-y: auto;
        padding: 14px;
    }

    .costume-gallery {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .costume-card {
        padding: 14px;
    }

    .costume-card-header {
        flex-wrap: wrap;
    }

    .costume-card-date {
        white-space: normal;
    }

    .table-container tbody {
        max-height: none;
        overflow: visible;
    }

    .pagination {
        position: sticky;
        bottom: 0;
        margin: 0 -14px;
        padding: 10px 14px calc(8px + env(safe-area-inset-bottom));
        background: var(--pagination-mobile-bg);
        backdrop-filter: blur(8px);
    }

    .patch-date {
        position: static;
        max-width: 100%;
    }

    .detail-header-actions {
        width: 100%;
        padding-left: 0;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }

    .wiki-page {
        padding: 16px;
        font-size: 14px;
        text-align: left;
    }

    .details-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .details-text-links {
        position: static;
        order: -1;
    }

    .wiki-image {
        width: 100%;
        max-width: 100%;
        max-height: 280px;
    }

    .faq-source-footer,
    .similar-searches {
        padding-top: 12px;
        font-size: 13px;
    }

    .suggest-edit-grid {
        grid-template-columns: 1fr;
    }

    .suggest-edit-actions {
        align-items: flex-start;
    }

    .suggest-edit-card {
        padding: 16px;
    }

    .settings-panel {
        min-height: 0;
    }

    .credits-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .mobile-fab {
        top: 26px;
        left: 14px;
    }
}

@media (max-width: 520px) {
    .wiki-header {
        align-items: flex-start;
    }

    .wiki-header h3 {
        width: 100%;
        margin: 0;
        font-size: 18px;
        line-height: 1.35;
    }

    .patch-date {
        margin-left: 0;
    }

    .detail-header-actions {
        align-items: flex-start;
    }

    .pagination {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .pagination button {
        margin: 0;
        min-width: 36px;
    }

    .table-container table {
        min-width: 620px;
    }
}

/* Final calculator button overrides */
.shop-calculator-toolbar button.suggest-edit-button {
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    line-height: 1 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.shop-calculator-toolbar button.shop-calculator-danger-button,
body.theme-light .shop-calculator-toolbar button.shop-calculator-danger-button {
    background: #dc2626 !important;
    color: #ffffff !important;
}

.shop-calculator-toolbar button.shop-calculator-danger-button:hover:not(:disabled),
body.theme-light .shop-calculator-toolbar button.shop-calculator-danger-button:hover:not(:disabled) {
    background: #b91c1c !important;
}

.shop-calculator-toolbar button.shop-calculator-danger-button:active:not(:disabled),
body.theme-light .shop-calculator-toolbar button.shop-calculator-danger-button:active:not(:disabled) {
    background: #991b1b !important;
}
