/* Mabinogi DPS Ranking Plugin Styles */ 

/* ==========================================================================
   Theme Variables & Dark Mode
   ========================================================================== */
:root {
    --primary-color: #F65606;
    --background-color: #ffffff;
    --text-color: #333333;
    --text-color-light: #555555;
    --card-background: #ffffff;
    --border-color: #dddddd;
    --header-bg: #ffffff;
    --header-text: #333333;
    --button-bg: #2BAF7E;
    --button-text: #ffffff;
    --link-color: #007bff;
    --link-hover-color: #ff2600;
    --input-bg: #ffffff;
    --input-text: #333333;
    --input-border: #ccc;
    --table-header-bg: #f2f2f2;
    --table-row-even-bg: #f9f9f9;
}

body.dark-mode {
    --background-color: #1a1a1a;
    --text-color: #e0e0e0;
    --text-color-light: #bbbbbb;
    --card-background: #2c2c2c;
    --border-color: #444444;
    --header-bg: #2c2c2c;
    --header-text: #e0e0e0;
    --link-color: #4dabf7;
    --link-hover-color: #ff7a29;
    --input-bg: #2c2c2c;
    --input-text: #e0e0e0;
    --input-border: #555555;
    --table-header-bg: #3c3c3c;
    --table-row-even-bg: #333333;
}

#breadcrumbs {
    font-size: 1px;
    color: var(--background-color);
}

#breadcrumbs a {
    color: var(--background-color);
}

#site-header {
    display: none;
}

/* ==========================================================================
   Header Styles
   ========================================================================== */
body {
    /* 다크모드 추가
    background-color: var(--background-color); 
    color: var(--text-color);
    /* Add padding to prevent content from being hidden by the sticky header */
    /* The value should be slightly more than the header's height */
    padding-top: 80px; 
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#mdr-content {
    flex: 1;
}

#mdr-header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 5px 20px;
    position: fixed; /* Use fixed positioning */
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    box-sizing: border-box;
}

.mdr-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.mdr-logo img {
    max-height: 50px; /* Controls the height of the header */
    width: auto;
    display: block;
}

.mdr-nav-set {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mdr-mobile-nav-icons {
    display: none; /* Hidden by default, shown on mobile */
    align-items: center;
    gap: 15px;
}

.mdr-mobile-nav-icons a,
.mdr-mobile-nav-icons button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mdr-mobile-nav-icons .icon-svg {
    width: 28px;
    height: 28px;
    fill: var(--header-text);
}

.mdr-login-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    justify-content: flex-end;
    gap: 10px; /* Spacing between menu items */ 
}

.mdr-login-nav a {
    text-decoration: none !important;
    color: var(--header-text);
    font-weight: 500;
    font-size: 16px;
    transition: color 0.2s;
}

.mdr-login-nav a:hover {
    color: var(--link-hover-color); /* Theme color */
}

.mdr-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    justify-content: flex-start;
    gap: 25px; /* Spacing between menu items */
}

.mdr-nav a {
    text-decoration: none !important;
    color: var(--header-text);
    font-weight: 500;
    font-size: 20px;
    transition: color 0.2s;
}

.mdr-nav a:hover {
    color: var(--link-hover-color); /* Theme color */
}

#mdr-footer {
    background-color: var(--card-background);
    padding: 20px;
    text-align: center;
    color: var(--text-color-light);
    margin-top: auto; /* 푸터를 하단으로 밀어냄 */
}

.mdr-footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.mdr-footer-links {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 0px 10px;
}

.mdr-footer-links a {
    color: var(--text-color-light);
    text-decoration: none;
}

.mdr-footer-links a:hover {
    color: var(--link-hover-color);
}

.mdr-footer-copyright {
    margin-top: 10px;
    font-size: 0.9em;
}

.mdr-login-form {
    max-width: 400px;
    margin: 20px auto;
    border: 1px solid var(--border-color);
    padding: 20px;
}

/* Character Info Page Styles */
.mdr-character-info-container {
    max-width: 960px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--card-background);
}

.character-profile {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.character-image {
    margin-right: 30px;
}

.character-image img {
    max-width: 150px;
    height: auto;
    border-radius: 50%;
    border: 3px solid #eee;
}

.character-details h3 {
    margin: 0 0 10px 0;
    font-size: 1.5em;
}

.character-details p {
    margin: 5px 0;
    font-size: 1.1em;
    color: var(--text-color);
}

.character-stats, .character-equipment, .character-extra-info {
    margin-bottom: 20px;
}

.mdr-stats-table {
    width: 100%;
    border-collapse: collapse;
}

.mdr-stats-table th, .mdr-stats-table td {
    padding: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.mdr-stats-table th {
    background-color: var(--table-header-bg);
    width: 200px;
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
}

.equipment-slot {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
}

.slot-name {
    font-weight: bold;
    color: #333;
}

.item-name {
    color: #005aee;
}

.character-extra-info {
    display: flex;
    gap: 20px;
}

.info-section {
    flex: 1;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
}

/* Mabinogi DPS Ranking Plugin Custom Styles */
.mdr-form-errors {
    color: #dc3232;
    border: 1px solid #dc3232;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.mdr-form-errors ul {
    margin: 0;
    padding-left: 20px;
}

.error-message {
    color: #dc3232;
    font-size: 0.9em;
    margin-top: 5px;
}

.success-message {
    color: #0073aa; /* WordPress blue */
    font-size: 0.9em;
    margin-top: 5px;
}

#mdr-ranking-wrapper {
    margin-top: 20px;
}

#mdr-filters-and-search-form {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

/* Hall of Fame Styles */
.mdr-hall-of-fame {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.mdr-hall-of-fame h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7em; /* 폰트 크기 조정 */
    margin-bottom: 20px;
}

.hall-of-fame-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 20px;
}
.hall-of-fame-item {
    position: relative;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.hall-of-fame-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.hall-of-fame-item .rank-number {
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: transparent;
    color: #111111;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
    z-index: 999;
}
.hall-of-fame-item .character-info .character-name {
    font-weight: bold;
    font-size: 1.1em;
    color: #1e90ff;
}
.hall-of-fame-item .character-info .character-name a {
    text-decoration: none;
    color: #1e90ff;
}
.hall-of-fame-item .character-info div {
    margin-top: 5px;
    font-size: 0.9em;
    color: #555;
}

.mdr-hall-of-fame .hall-of-fame-item .character-info .character-name a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

.mdr-hall-of-fame .hall-of-fame-item .character-info .character-name a:hover {
    color: #1e90ff; /* Or any color that fits your theme */
    text-decoration: underline;
}

.mdr-hall-of-fame .hall-of-fame-item .character-info .dps {
    font-size: 0.9em;
    color: #c0392b; /* A red color for DPS */
    font-weight: bold;
}

/* Correct Hall of Fame Image Styles */
.mdr-hall-of-fame .character-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 10px;
    padding: 5px; /* 경계 공간 확보 */
    background: linear-gradient(135deg, #FFD700, #FF8C00); /* 그라데이션 보더 */
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
}

.mdr-hall-of-fame .character-image img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #f8f9fa; /* 안쪽 배경 */
    display: block;
    object-fit: cover; /* Ensures the image covers the area, cropping if necessary */
}

.mdr-hall-of-fame .character-image .no-image {
    font-size: 0.8em;
    color: #6c757d;
}

/* Ranking Table Styles */
.mdr-ranking-list table {
    margin-top: 30px;
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-background);
}

.mdr-ranking-list table th, .mdr-ranking-list table td {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    text-align: center;
    vertical-align: middle;
}

.mdr-ranking-list tbody td:nth-child(2) { /* Character name column */
    text-align: left;
}

.mdr-ranking-list table tbody tr:nth-child(even) {
    background-color: var(--table-row-even-bg);
}

.mdr-ranking-list table th {
    background-color: var(--table-header-bg);
    width: 200px;
}

.mdr-ranking-list td {
    background-color: transparent !important;
}

.mdr-ranking-list td a {
    color: #1e90ff;
    text-decoration: none;
}

.mdr-ranking-list td a:hover {
    text-decoration: underline;
}

.mdr-ranking-list .mdr-char-name {
    font-weight: bold;
    font-size: 1em !important;
}

.mdr-ranking-list .mdr-char-name a {
    text-decoration: none;
    color: #1e90ff;
    transition: color 0.3s;
}

.mdr-ranking-list .mdr-char-name a:hover {
    color: #1e90ff;
    text-decoration: underline;
}

/* Character Input Form Styles */
#mdr-character-input-form .form-group {
    margin-bottom: 20px;
}

#mdr-character-input-form .form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}

/* --- Unified Input and Select2 Styles --- */
#mdr-character-input-form .form-group input[type="text"],
#mdr-character-input-form .form-group input[type="number"],
#mdr-character-input-form .form-group input[type="file"],
#mdr-character-input-form .form-group textarea,
#mdr-character-input-form .form-group .select2-container .select2-selection--single {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    box-sizing: border-box; /* Crucial for consistent sizing */
    color: var(--input-text);
    background-color: var(--input-bg);
}

#mdr-character-input-form .form-group input[type="text"],
#mdr-character-input-form .form-group input[type="number"],
#mdr-character-input-form .form-group .select2-container .select2-selection--single {
    height: 42px; /* Enforce uniform height */
}

#mdr-character-input-form .select2-container .select2-selection--single {
    display: flex;
    align-items: center; /* Vertically center text in Select2 */
}
/* --- End of Unified Styles --- */

#mdr-character-input-form textarea {
    resize: vertical;
}

#mdr-character-input-form .form-row {
    display: flex;
    gap: 20px;
}

#mdr-character-input-form .form-row .form-group {
    flex: 1;
}

#mdr-character-input-form .horizontal-selects {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#mdr-character-input-form .horizontal-selects > .select2-container {
    flex: 1 1 calc(33.333% - 10px);
}

#mdr-character-input-form .form-submit-row {
    text-align: right;
    margin-top: 30px;
}


#mdr-suggestion-form .form-group {
    margin-top: 15px;
}

#mdr-suggestion-form .submit-group{
    text-align: right;
    margin-top: 30px;
}

#mdr-submit-btn {
    padding: 12px 25px;
    background-color: #F65606;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

#mdr-submit-btn:hover {
    background-color: #ff2600;
}

/* Skill Modification styles */
#mdr-skill-modification {
    margin-top: 15px;
    gap: 15px;
}
.skill-mod-item {
    flex: 1 1 calc(16.666% - 15px);
    display: flex;
    flex-direction: column;
}
.skill-mod-item label {
    font-size: 13px;
    margin-bottom: 5px;
    text-align: center;
    color: #555;
}
.skill-mod-item input {
    text-align: center;
}
#skill-mod-total {
    margin-top: 10px;
    font-weight: bold;
    text-align: right;
    color: #333;
}
#skill-mod-total span {
    font-size: 1.2em;
}

/* Character Info Page - Skill Display */
.skill-modification-grid {
    margin: 15px auto;
}
.skill-row {
    display: flex;
    justify-content: center;
    gap: 40px; /* 원 사이의 간격 */
    margin-bottom: 10px;
}
.top-row {
    margin-left: 50px; /* 지그재그 효과 */
}
.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.skill-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #f0f8ff;
    border: 2px solid #add8e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: bold;
    color: #c0392b;
    margin-bottom: 10px;
}
.skill-circle.is-default {
    color: #555;
}
.skill-label {
    font-size: 1em;
    color: #333;
    font-weight: 500;
}

.skill-combo-details {
    margin-top: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 5px;
    line-height: 1.6;
}

/* Common Page Title Style */
.page-header {
    text-align: center;
    margin-bottom: 30px;
}

/* ==========================================================================
   Content
   ========================================================================== */
.entry-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    position: relative;
    /* 밑줄 효과를 위한 background 속성 추가 */
    /* background: linear-gradient(var(--primary-color), var(--primary-color)) center bottom / 10% 3px no-repeat; */
}

.entry-title::before,
.entry-title::after {
    content: '';
    display: inline-block;
    width: 70px;
    height: 32px; /* 높이를 font-size에 맞춰 조정 */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center; /* 이미지를 요소 중앙에 위치시킴 */
    margin: 0 15px;
    flex-shrink: 0; /* flex 컨테이너 내에서 크기 유지 */
}

.entry-title::before {
    background-image: url('../images/hall-of-fame-prefix.png');
}

.entry-title::after {
    background-image: url('../images/hall-of-fame-suffix.png');
}

.page-content,
.entry-content,
.entry-summary {
    margin-bottom: 30px;
}

/* Character Info Page Specific Styles */
.character-profile-header {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: center;
    padding: 20px 10px;
    margin-bottom: 20px;
}

.character-profile-header .character-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-bottom: 10px;
    padding: 5px;
    background: linear-gradient(135deg,#E270BA, #db229b);
    box-sizing: border-box;
    overflow: hidden;
    flex-shrink: 0;
}

.character-profile-header .character-image img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #f8f9fa; /* 안쪽 배경 */
    display: block;
    object-fit: cover; /* Ensures the image covers the area, cropping if necessary */
}

.character-summary h2 {
    color: var(--header-text);
    font-size: 24px;
}

.character-summary .server-class {
    font-size: 1.2em;
    color: #333;
    margin: 5px 0 15px;
}

.character-summary .main-stats-new {
    margin-top: 15px;
}

.main-stats-new .stat-line {
    font-size: 1.2em;
    margin: 5px 0;
    color: #333;
}

.main-stats-new .stat-number {
    color: #c0392b;
}

.character-details {
    margin-bottom: 25px; /* Added vertical margin */
}

.character-details h3 {
    margin-bottom: 15px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
}

.mdr-select-class .select2-container--default .select2-selection--single {
    height: 42px !important;
    border: 1px solid rgb(102, 102, 102) !important;
}

.mdr-select-class .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px !important;
}

.mdr-select-class .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.equipment-item {
    background: #fff;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
}

/* Item Info Modal Styles */
#mdr-item-info-modal {
    max-width: 420px;
    width: calc(100vw - 40px);
    background: #18181b; /* Dark background */
    color: #e0e0e0;
    border-radius: 24px;
    padding: 0;
    border: 2px solid;
    box-shadow: 0 0 40px 10px;
    overflow: visible; /* For corner ornaments */
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* Grade-specific Themes */
#mdr-item-info-modal.grade-전설 {
    border-color: #CE6026;
    box-shadow: 0 0 40px 10px rgba(206, 96, 38, 0.6);
}
#mdr-item-info-modal.grade-에픽 {
    border-color: #ED16A8;
    box-shadow: 0 0 40px 10px rgba(237, 22, 168, 0.6);
}
#mdr-item-info-modal.grade-유니크 {
    border-color: #fffdef;
    box-shadow: 0 0 40px 10px rgba(240, 230, 140, 0.6);
}
#mdr-item-info-modal.grade-엘리트 {
    border-color: #9656FF;
    box-shadow: 0 0 40px 10px rgba(150, 86, 255, 0.6);
}
#mdr-item-info-modal.grade-레어 {
    border-color: #1D78F1;
    box-shadow: 0 0 40px 10px rgba(29, 120, 241, 0.6);
}
#mdr-item-info-modal.grade-고급 {
    border-color: #00A347;
    box-shadow: 0 0 40px 10px rgba(0, 163, 71, 0.6);
}

#mdr-item-info-modal::backdrop {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.mdr-modal-content {
    padding: 28px 24px;
    position: relative;
}

.mdr-modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent !important;
    border: none !important;
    outline: none; /* Remove focus outline */
    color: #ddd;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
    padding: 0;
    z-index: 10;
}
.mdr-modal-close-btn:hover {
    color: #fff;
    transform: scale(1.1);
    background: transparent !important;
    border: none !important;
    outline: none; /* Remove focus outline */
}

.mdr-modal-item-stars {
    font-size: 1.5em;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-align: center;
}
.grade-전설 .mdr-modal-item-stars,
.grade-에픽 .mdr-modal-item-stars,
.grade-엘리트 .mdr-modal-item-stars,
.grade-레어 .mdr-modal-item-stars,
.grade-고급 .mdr-modal-item-stars {
    color: #FFD700;
}

.mdr-modal-item-name {
    font-size: 1.7em;
    font-weight: 700;
    margin: 0;
    text-align: center;
    line-height: 1.2;
}
.grade-전설 .mdr-modal-item-name { color: #CE6026; }
.grade-에픽 .mdr-modal-item-name { color: #ED16A8; }
.grade-유니크 .mdr-modal-item-name { color: #fffdef; }
.grade-엘리트 .mdr-modal-item-name { color: #9656FF; }
.grade-레어 .mdr-modal-item-name { color: #1D78F1; }
.grade-고급 .mdr-modal-item-name { color: #00A347; }

.mdr-modal-item-subtitle {
    text-align: center;
    font-size: 1.1em;
    color: #bbb;
    margin: 4px 0 16px 0;
}

.mdr-subtitle-grade {
    font-weight: bold;
}
.grade-전설 .mdr-subtitle-grade { color: #CE6026; }
.grade-에픽 .mdr-subtitle-grade { color: #ED16A8; }
.grade-유니크 .mdr-subtitle-grade { color: #fffdef; }
.grade-엘리트 .mdr-subtitle-grade { color: #9656FF; }
.grade-레어 .mdr-subtitle-grade { color: #1D78F1; }
.grade-고급 .mdr-subtitle-grade { color: #00A347; }

.mdr-modal-hr {
    border: none;
    height: 1.5px;
    background-color: rgba(255, 255, 255, 0.15);
    margin: 20px 0;
}

.mdr-modal-section {
    margin-bottom: 16px;
    line-height: 1.6;
}

.mdr-modal-effect {
    font-size: 1.1em;
}

.mdr-effect-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9em;
    color: #18181b;
    margin-right: 8px;
}

.grade-전설 .mdr-effect-badge { background-color: #CE6026; }
.grade-에픽 .mdr-effect-badge { background-color: #ED16A8; }
.grade-유니크 .mdr-effect-badge { background-color: #fffdef; }
.grade-엘리트 .mdr-effect-badge { background-color: #9656FF; }
.grade-레어 .mdr-effect-badge { background-color: #1D78F1; }
.grade-고급 .mdr-effect-badge { background-color: #00A347 }

.mdr-modal-description {
    color: #ccc;
    font-size: 1em;
    white-space: pre-wrap;
}

.mdr-modal-loading {
    text-align: center;
    padding: 60px 0;
    font-size: 1.2em;
    color: #888;
}

/* Modal Open/Close Animation */
#mdr-item-info-modal[open] {
  animation: fadeIn 0.3s ease-out;
}
#mdr-item-info-modal.closing {
  animation: fadeOut 0.3s ease-in forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(20px) scale(0.98); }
}

/* === Character Input Page Final Overrides (Append to end of file) === */

/*
 * Force consistent height and styling for all standard input fields and Select2.
 * Using high specificity to ensure these rules apply over existing ones.
 */
#mdr-character-input-form .form-group input[type="text"],
#mdr-character-input-form .form-group input[type="number"],
#mdr-character-input-form .select2-container .select2-selection--single {
    height: 42px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    padding: 0 10px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
}

#mdr-character-input-form .select2-container .select2-selection__rendered {
    line-height: 40px !important;
}

#mdr-character-input-form .select2-container .select2-selection__arrow {
    height: 40px !important;
}

/* Ensure textarea is not affected by height override */
#mdr-character-input-form .form-group textarea {
    height: auto !important;
} 

/* === FINAL LAYOUT STYLES (Previously injected via JS) === */

/* --- General Button & Title Alignment --- */
.mdr-ranking-header { 
    text-align: right; 
}
/* 룬 통계 페이지 접근 제한 안내 메시지 */
.mdr-notice-wrapper {
    text-align: center;
}

.button.notice {
    text-align: center !important;
    font-size: 28px;
    font-weight: bold;
    transition: color 0.3s;
    display: block;
    margin-bottom: 10px;
}
.button.notice:hover {
    color: #e9165c !important;
}

/* --- Ranking Page: Filters --- */
.mdr-back-to-hub-btn {
    font-size: 1.0em !important;
    font-weight: bold !important;
    transition: color 0.3s;
}

.mdr-back-to-hub-btn:hover {
    color: #e9165c !important;
}

.mdr-boss-card-difficulty {
    padding: 5px 15px 15px;
    color: #ddd;
    font-size: 0.9em;
}

.mdr-filter-area { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: space-between; 
    align-items: flex-end; 
    gap: 20px; 
    margin-bottom: 30px; 
}
.mdr-select-area { 
    display: flex; 
    gap: 15px; 
}
.mdr-select-class {
    width: 120px;
}
.mdr-select-class label {
    font-size: 1.0em !important;
}
.mdr-select-area > div {
    flex-grow: 1;
}
.mdr-select-server, .mdr-select-class { 
    display: flex; 
    flex-direction: column; 
    gap: 5px; 
}
.mdr-search-character { 
    position: relative; 
}
.mdr-search-character input[type="text"] { 
    padding-right: 40px !important; 
}
.mdr-search-character .mdr-search-btn { 
    position: absolute; 
    right: 0; 
    top: 0; 
    bottom: 0; 
    width: 40px; 
    border: 1px solid rgb(102, 102, 102); 
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2'%3e%3ccircle cx='11' cy='11' r='8'/%3e%3cline x1='21' y1='21' x2='16.65' y2='16.65'/%3e%3c/svg%3e") no-repeat center; 
    cursor: pointer; 
    text-indent: -9999px; 
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
}
.mdr-search-btn:focus,
.mdr-search-btn:active {
    border-color: rgb(102, 102, 102) !important;
    background-color: transparent !important;
    color: transparent !important;
}
.mdr-search-character .mdr-search-btn:hover {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='11' cy='11' r='8'%3e%3c/circle%3e%3cline x1='21' y1='21' x2='16.65' y2='16.65'%3e%3c/line%3e%3c/svg%3e") no-repeat center;
}

/* --- Ranking Page: Modern Pagination --- */
.mdr-pagination-modern { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 8px; 
    margin-top: 20px; 
}
.mdr-pagination-modern .pagination-btn { 
    width: 36px; 
    height: 36px; 
    padding: 0; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    background-color: #333; 
    cursor: pointer; 
    mask-repeat: no-repeat; 
    mask-position: center; 
    mask-size: 50%; 
}
.mdr-pagination-modern .pagination-btn:hover:not(:disabled) { 
    background-color: #000; 
}
.mdr-pagination-modern .pagination-btn:disabled { 
    background-color: #ccc; 
    cursor: not-allowed; 
    opacity: 0.6; 
}
.mdr-pagination-modern .page-indicator { 
    padding: 0 12px; 
}
.mdr-pagination-modern .page-indicator .current-page { 
    font-weight: bold; 
}
.mdr-pagination-modern .pagination-btn.first-page { 
    mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z'/%3e%3c/svg%3e"); 
}
.mdr-pagination-modern .pagination-btn.prev-page { 
    mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6z'/%3e%3c/svg%3e"); 
}
.mdr-pagination-modern .pagination-btn.next-page { 
    mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6z'/%3e%3c/svg%3e"); 
}
.mdr-pagination-modern .pagination-btn.last-page { 
    mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z'/%3e%3c/svg%3e"); 
}

/* ==========================================================================
   My Characters Page
   ========================================================================== */
.mdr-add-character-link-top {
    margin-bottom: 0px;
    text-align: center;
}

.button.primary {
    font-size: 20px;
    font-weight: bold !important;
    transition: color 0.3s;
}
.button.primary:hover {
    color: #e9165c !important;
}

.my-characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
    margin-top: 20px;
}

.my-character-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.my-character-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.my-character-item .character-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 10px;
    padding: 5px;
    background: linear-gradient(135deg,#E270BA, #db229b);
    display: block;
    box-sizing: border-box;
    overflow: hidden;
}

.my-character-item .character-image img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #f8f9fa; /* 안쪽 배경 */
    display: block;
    object-fit: cover; /* Ensures the image covers the area, cropping if necessary */
}

.my-character-item .character-image .no-image {
    font-size: 0.8em;
    color: #6c757d;
}

.my-character-item .character-info {
    flex-grow: 1;
    margin-bottom: 15px;
}

.my-character-item .character-name {
    font-weight: bold;
    font-size: 1.1em !important;
    margin-bottom: 8px;
}

.my-character-item .character-name a {
    text-decoration: none;
    color: #1e90ff;
    transition: color 0.3s;
}

.my-character-item .character-name a:hover {
    color: #1e90ff;
    text-decoration: underline;
}

.my-character-item .character-info div {
    margin-top: 4px;
    font-size: 1em;
    color: rgb(51, 51, 51);
}

.my-character-item .dps {
    font-weight: bold;
    color: #c0392b !important;
}

.my-character-item .character-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.my-character-item .character-actions .button {
    flex-grow: 1;
    text-align: center;
    padding: 8px 10px;
    font-size: 0.9em;
}

.my-character-item .character-actions .button:hover {
    color: #e9165c !important;
}

/* --- 캐릭터 정보 입력 페이지 --- */
#mdr-character-input-wrapper h2 {
    font-size: 24px;
}

/* --- Character Input Page: Horizontal Selects --- */
#mdr-character-input-form .horizontal-selects { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 15px; 
}
#mdr-character-input-form .horizontal-selects .select2-container { 
    flex: 1 1 150px; 
    min-width: 150px; 
}

/* --- Character Input Page: Image Cropper --- */
#mdr-cropper-ui { /* The main container for editor and preview */
    display: flex;
    align-items: center;
    justify-content: center; /* Center the items if they don't fill the space */
    gap: 30px; /* Space between editor and preview */
    padding: 10px;
    border-radius: 5px;
    background-color: #f8f9fa; /* Light background for the container */
}

#mdr-cropper-ui .cropper-main {
    width: 400px; /* A good size for the editor */
    height: 400px;
}

#mdr-cropper-ui .cropper-preview-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#mdr-cropper-ui .cropper-preview-circle {
    width: 320px; /* Make preview same size as editor */
    height: 320px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #ddd;
}

/* Make the crop box visually circular */
.cropper-view-box,
.cropper-face {
    border-radius: 50%;
}

/* --- Character Input Page: Skill Modification --- */
#mdr-skill-modification {
    gap: 15px;
}
.skill-mod-item {
    flex: 1 1 calc(16.666% - 15px);
    display: flex;
    flex-direction: column;
}
.skill-mod-item label {
    font-size: 13px;
    margin-bottom: 5px;
    text-align: center;
    color: #555;
}
.skill-mod-item input {
    text-align: center;
}
#skill-mod-total {
    margin-top: 10px;
    font-weight: bold;
    text-align: right;
    color: #333;
}
#skill-mod-total span {
    font-size: 1.2em;
}

/* Rune Stats Page */
#mdr-rune-stats-wrapper {
    max-width: 1200px;
    margin: 0px auto 20px auto;
    padding: 0px 20px 20px 20px;
    font-family: sans-serif;
}

#mdr-stats-filters {
    margin-bottom: 20px;
    text-align: center;
}

.mdr-filter-btn {
    background: #f0f0f0;
    border: 1px solid #ccc;
    padding: 8px 15px;
    cursor: pointer;
    margin: 0 5px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.mdr-filter-btn:hover {
    background: #e0e0e0;
}

.mdr-filter-btn.active {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.mdr-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.mdr-class-stats-card {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.mdr-class-title {
    margin-top: 0;
    font-size: 1.5em;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.mdr-class-total {
    font-size: 0.7em;
    color: #666;
    font-weight: normal;
}

.mdr-stats-section h4 {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.mdr-equipment-stats {
    margin-bottom: 15px;
}

.mdr-equipment-stats strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.mdr-equipment-stats ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mdr-equipment-stats li {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.95em;
}

.mdr-item-name.equipment-name-clickable {
    cursor: pointer;
    background-color: transparent;
    padding: 5px 10px;
    border-radius: 10px;
    color: var(--link-color);
    transition: color 0.2s;
}

.mdr-item-name.equipment-name-clickable:hover {
    background-color: transparent;
    color: var(--primary-color);
}

.mdr-item-name {
    width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.mdr-bar-container {
    flex-grow: 1;
    height: 18px;
    background-color: #e9ecef;
    border-radius: 4px;
    margin: 0 10px;
}

.mdr-bar {
    height: 100%;
    background-color: var(--button-bg);
    border-radius: 4px;
    transition: width 0.5s ease-in-out;
}

.mdr-item-percentage {
    width: 50px;
    text-align: right;
    font-weight: bold;
    color: #495057;
}

.mdr-skill-mods-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    text-align: center;
}

.mdr-skill-mod-item {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
}

.mdr-skill-num {
    display: block;
    font-size: 0.9em;
    color: #6c757d;
}

.mdr-skill-val {
    display: block;
    font-size: 1.4em;
    font-weight: bold;
}

.mdr-skill-val.mdr-skill-zero {
    color: var(--text-color-light);
}

.mdr-skill-val.mdr-skill-non-zero {
    color: var(--button-bg);
}
.mdr-skill-val.is-default {
    color: #555;
}

/* --- Rune Stats Page --- */
.mdr-page-description {
    text-align: right;
    font-size: 14px;
    color: var(--text-color-light);
    margin-bottom: 10px;
}

.mdr-skill-layout-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 10px; /* 아이템 사이의 간격 */
}

.mdr-skill-build-separator {
    border: 0;
    height: 1px;
    background-color: #ddd;
    margin: 15px 0;
}

#mdr-stats-filters {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.mdr-filter-group-period, .mdr-filter-group-class-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mdr-period-filter-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
}

#mdr-stats-filters h2 {
    margin: 0 0 5px;
    font-size: 24px;
    color: var(--header-text);
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

.mdr-filter-group-period .mdr-period-filter-btn, .mdr-class-filter-btn {
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    text-align: center;
    color: var(--text-color) !important;
    font-weight: bold;
}

.mdr-filter-group-period .mdr-period-filter-btn:hover, .mdr-class-filter-btn:hover {
    background-color: var(--primary-color);
    color: #fff !important;
    border-color: var(--primary-color);
    font-weight: bold;
}

.mdr-filter-group-period .mdr-period-filter-btn.active, .mdr-class-filter-btn.active {
    background-color: var(--primary-color);
    color: #fff !important;
    border-color: var(--primary-color);
    font-weight: bold;
}

.mdr-filter-group-class {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.mdr-class-category h5 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #555;
}

.mdr-class-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* 필터링 시 통계 카드 너비 조정 */
#mdr-stats-content.filter-active .mdr-stats-grid {
    display: flex;
    justify-content: center;
}

#mdr-stats-content.filter-active .mdr-class-stats-card {
    flex-basis: 100%; /* 부모 컨테이너에 맞춰 너비를 채우도록 설정 */
    max-width: 500px; /* 카드의 최대 너비를 제한하여 너무 커지지 않게 함 */
}

/* 룬 통계 페이지 아이템 이름 클릭 시 효과 */
.equipment-name-clickable {
    cursor: pointer;
    background-color: var(--primary-color);
    padding: 5px 10px;
    margin-left: 10px;
    border-radius: 10px;
    color: #fff;
    transition: color 0.2s;
}
    
.equipment-name-clickable:hover {
    background-color: var(--link-hover-color);
}

.equipment-name-clickable.grade-전설 { background-color: #F65606 !important; }
.equipment-name-clickable.grade-전설:hover { background-color: var(--link-hover-color) !important; }

.equipment-name-clickable.grade-에픽 { background-color: #ED16A8 !important; }
.equipment-name-clickable.grade-에픽:hover { background-color: #d80e9a !important; }

.equipment-name-clickable.grade-유니크 { 
    background-color: #fffad7 !important; 
    color: #111 !important;
    border: 1px solid #555;
} 
.equipment-name-clickable.grade-유니크:hover { background-color: #fff1ba !important; }

.equipment-name-clickable.grade-엘리트 { background-color: #9656FF !important; }
.equipment-name-clickable.grade-엘리트:hover { background-color: #8236fd !important; }

.equipment-name-clickable.grade-레어 { background-color: #1D78F1 !important; }
.equipment-name-clickable.grade-레어:hover { background-color: #175fa3 !important; }

.equipment-name-clickable.grade-고급 { background-color: #00A347 !important; }
.equipment-name-clickable.grade-고급:hover { background-color: #008a3a !important; }

/* Boss Hub page styles */
#mdr-boss-hub-wrapper {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9; 
    border-radius: 10px;
}

.mdr-hub-description {
    margin-bottom: 40px;
    color: var(--text-color-light);
    font-size: 1.1em;
}

.mdr-boss-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

/* 보스 카드 1개일 때 가운데 배치 */
.mdr-boss-grid.single-item {
    display: flex;
    justify-content: center;
}

.mdr-boss-grid.single-item .mdr-boss-card {
    flex-basis: 100%;
    max-width: 300px;
}

.mdr-boss-card {
    display: block;
    text-decoration: none !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid transparent;
    background-color: #2c2c2c;
}
.mdr-boss-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}
.mdr-boss-card-image {
    width: 100%;
    height: 300px; /* Fixed height for boss images */
    object-fit: cover;
}

.mdr-no-boss-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
}
.mdr-boss-card-name {
    padding: 0px 15px;
    background-color: rgba(0,0,0,0.8);
    color: #fff;
    font-weight: bold;
    font-size: 1.2em;
}

.mdr-boss-card-difficulty {
    padding: 0px 15px 20px 15px;
    background-color: rgba(0,0,0,0.8);
    color: #fff;
    font-weight: bold;
    font-size: 1.2em;
}

/* Base style for mobile nav container (hidden by default) */
#mdr-mobile-nav-container {
    display: none;
}

/* --- 이용안내 페이지 --- */
body.page-id-83 .page-content h2.wp-block-heading {
    font-size: 24px;
    font-weight: bold;
    color: var(--header-text);
    margin: 50px 0 20px 0;
}

body.page-id-83 .page-content h2.wp-block-heading a {
    color: var(--link-color);
}

body.page-id-83 .page-content p {
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-color);
    margin-bottom: 20px;
}

/* ==========================================================================
   Navigation Menu Styles (Desktop & Mobile)
   ========================================================================== */
.mdr-nav ul li {
    position: relative; /* Needed for desktop dropdown positioning */
}

.mdr-nav ul .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mdr-nav ul .sub-menu li a {
    display: block;
    box-sizing: border-box;
    width: 100%;
}

/* --- Desktop Dropdown Styles --- */
@media (min-width: 1025px) {
    .mdr-nav ul .sub-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--card-background);
        border: 1px solid var(--border-color);
        border-top: none;
        min-width: 200px;
        z-index: 1000;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        border-radius: 0 0 4px 4px;
    }

    .mdr-nav ul li:hover > .sub-menu {
        display: block;
    }

    .mdr-nav ul .sub-menu li a {
        padding: 12px 15px;
        font-size: 16px;
        color: var(--text-color);
        border-bottom: 1px solid var(--border-color);
        text-align: left;
        transition: background-color 0.2s, color 0.2s;
    }

    .mdr-nav ul .sub-menu li:last-child a {
        border-bottom: none;
    }

    .mdr-nav ul .sub-menu li a:hover {
        background-color: var(--table-row-even-bg);
        color: var(--link-hover-color);
    }
}
/* ==========================================================================
   Responsive Styles 반응형 디자인
   ========================================================================== */
@media (max-width: 1024px) {
    body {
    padding-top: 70px; 
    }
    /* --- Header --- */
    .mdr-header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 15px; /* Add gap for spacing */
    }
    .mdr-logo {
        flex: 1 1 auto; /* Allow logo to shrink */
        min-width: 0; /* Prevent overflow */
    }
    .mdr-logo img {
        max-height: 45px;
    }
    .mdr-nav-set {
        display: none;
    }
    .mdr-mobile-nav-icons {
        display: flex;
        flex: 0 0 auto; /* Prevent icons from shrinking */
        flex-wrap: nowrap; /* Ensure icons stay in a row */
    }

    /* --- Mobile Navigation Container --- */
    #mdr-mobile-nav-container {
        display: flex; /* This overrides the display: none default */
        position: fixed;
        top: 0;
        right: 0;
        width: 300px;
        height: 100%;
        background-color: var(--card-background);
        border-left: 1px solid var(--border-color);
        z-index: 10001;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        display: flex;
        flex-direction: column;
    }

    #mdr-mobile-nav-container.open {
        transform: translateX(0);
    }

    .mdr-mobile-nav-header {
        display: flex;
        justify-content: flex-end;
        padding: 10px;
        border-bottom: 1px solid var(--border-color);
    }
    .mdr-mobile-nav-header button {
        background: transparent;
        border: none;
        padding: 5px;
        cursor: pointer;
    }
    .mdr-mobile-nav-header .icon-svg {
        width: 28px;
        height: 28px;
        fill: var(--text-color);
        color: var(--text-color);
    }
    
    .mdr-mobile-nav-body {
        padding: 20px;
        flex-grow: 1;
        overflow-y: auto;
    }

    .mdr-mobile-nav-body .mdr-login-nav ul,
    .mdr-mobile-nav-body .mdr-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .mdr-mobile-nav-body a {
        display: block;
        padding: 15px 0;
        text-decoration: none;
        color: var(--text-color);
        font-size: 18px;
        border-bottom: 1px solid var(--border-color);
    }

    /* --- Mobile Sub-menu Indent Styles --- */
    .mdr-mobile-nav-body .sub-menu {
        padding-left: 20px !important; /* Indent sub-menu */
        border-left: 3px solid #888;
        margin: 10px 0 10px 10px !important;
        background-color: rgba(0,0,0,0.02); /* Slightly different background */
    }

    .mdr-mobile-nav-body .sub-menu a {
        padding: 10px 0;
        font-size: 16px; /* Smaller font size for sub-items */
        border: none; /* Remove bottom border from sub-items */
    }

    .mdr-mobile-nav-body .sub-menu li:last-child a {
        padding-bottom: 10px; /* Ensure padding consistency */
    }

    #mdr-hamburger-btn:focus, #mdr-hamburger-btn:active,
    #mdr-mobile-close-btn:focus, #mdr-mobile-close-btn:active {
        background-color: var(--border-color) !important;
        box-shadow: none !important; /* Remove default WordPress shadow */
    }
  
    /* --- Mobile Navigation Overlay --- */
    #mdr-mobile-nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 10000;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
    }
    #mdr-mobile-nav-overlay.open {
        display: block;
        opacity: 1;
    }

    /* --- 메인 콘텐츠 --- */
    .entry-title {
        font-size: 24px;
    }

    .button.notice {
        font-size: 20px;
    }

    #mdr-character-input-wrapper h2 {
        font-size: 20px;
    } /* 캐릭터 정보 입력 페이지 */

    .mdr-add-character-link-top {
        text-align: center;
    }

    .button.primary {
        font-size: 20px;
    }
    
    /* 모바일에서 보스 카드 1열로 배치 */
    .mdr-boss-grid {
        grid-template-columns: 1fr;
    }

    /* --- Ranking Page --- */
    .mdr-filter-area {
        flex-wrap: nowrap;
        gap: 10px;
    }
    .mdr-filter-area .mdr-select-area,
    .mdr-filter-area .mdr-search-character {
        flex: 1;
    }

    .mdr-hall-of-fame {
        display: none;
    }

    .mdr-ranking-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Momentum scrolling for iOS */
    }

    .mdr-ranking-list table {
        margin-top: 10px;
    }
    
    .mdr-filter-area { 
        margin-bottom: 10px; 
    }    

    .mdr-ranking-list table {
        table-layout: auto;
        width: 100%;
    }

    .mdr-ranking-list th,
    .mdr-ranking-list td {
        white-space: normal;
        text-overflow: clip;
        overflow: visible;
    }

    .mdr-ranking-list td:nth-child(2) {
        word-break: break-all;
    }

    .mdr-ranking-list th:nth-child(1), .mdr-ranking-list td:nth-child(1) { width: 10%; } /* 순위 */
    .mdr-ranking-list th:nth-child(2), .mdr-ranking-list td:nth-child(2) { width: auto; } /* 캐릭터명 */
    .mdr-ranking-list th:nth-child(3), .mdr-ranking-list td:nth-child(3) { width: 20%; } /* 직업 */
    .mdr-ranking-list th:nth-child(4), .mdr-ranking-list td:nth-child(4) { width: 30%; } /* 전투력 */
    .mdr-ranking-list th:nth-child(5), .mdr-ranking-list td:nth-child(5) { width: 30%; } /* DPS */
  
    /* --- Boss Hub Page --- */
    .mdr-boss-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        justify-items: center; /* Center the cards horizontally */
    }

    .mdr-boss-grid .mdr-boss-card {
        width: 100%; /* Ensure it's responsive on very small screens */
        max-width: 300px; /* But don't exceed 300px */
    }

    /* --- Character Info Page --- */
    #mdr-character-info-wrapper .skill-modification-grid {
        margin: 0 auto;
        width: fit-content;
        max-width: 100%;
    }

    /* --- Character Input Page --- */
    #mdr-character-input-form .form-row,
    #mdr-character-input-form .horizontal-selects:not(#mdr-skill-modification) { /* Exclude skill mods */
        display: flex;
        flex-direction: column;
        gap: 15px;
        height: auto !important; /* Let container height be automatic */
    }

    #mdr-character-input-form .horizontal-selects:not(#mdr-skill-modification) .select2-container {
        flex: 1 1 100%;
        width: 100%;
    }

    /* Force correct height on ALL select2 boxes in the form on mobile */
    #mdr-character-input-form .select2-container .select2-selection--single {
        height: 42px !important;
    }
    #mdr-character-input-form .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 40px !important;
    }
    #mdr-character-input-form .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 40px !important;
    }
    
    #mdr-character-input-form #mdr-skill-modification {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    #mdr-character-input-form #mdr-skill-modification .skill-mod-item:nth-child(1) { order: 4; }
    #mdr-character-input-form #mdr-skill-modification .skill-mod-item:nth-child(2) { order: 5; }
    #mdr-character-input-form #mdr-skill-modification .skill-mod-item:nth-child(3) { order: 6; }
    #mdr-character-input-form #mdr-skill-modification .skill-mod-item:nth-child(4) { order: 1; }
    #mdr-character-input-form #mdr-skill-modification .skill-mod-item:nth-child(5) { order: 2; }
    #mdr-character-input-form #mdr-skill-modification .skill-mod-item:nth-child(6) { order: 3; }

    .skill-mod-item {
        flex: auto; /* Reset flex property from desktop view */
    }

    /* Image Cropper Layout */
    #mdr-cropper-ui {
        flex-direction: column !important;
        width: 100%;
    }
    #mdr-cropper-ui .cropper-main,
    #mdr-cropper-ui .cropper-preview-area {
        width: 100% !important;
        max-width: 100%;
    }
    #mdr-cropper-ui .cropper-preview-circle {
        width: 250px !important; /* Adjust preview size for mobile */
        height: 250px !important;
        margin: 0 auto; /* Center the preview circle */
    }

    /* --- Character Info Page --- */
    .character-summary h2 {
        font-size: 20px;
    }
    .character-summary .server-class, .character-summary .stat-line {
        font-size: 18px;
    }

    #mdr-stats-filters h2 {
        font-size: 20px;
    }
    
    /* --- 이용안내 페이지 --- */
    body.page-id-83 .page-content h2.wp-block-heading {
        font-size: 20px;
        margin: 40px 0 15px 0;
    }

    body.page-id-83 .page-content p {
        margin-bottom: 15px;
    }
}

 

/* Overrides for very small screens */
@media (max-width: 425px) {
    body {
    padding-top: 60px; 
    }

    .entry-title {
        white-space: nowrap;
        font-size: 20px; /* 뷰포트 너비 기준 크기 */
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .button.notice {
        font-size: 18px;
    }
    .button.primary {
        font-size: 18px;
    }

    /* --- Character Info Page --- */
    .character-image {
        margin-right: 15px;
    }

    .character-summary h2 {
        font-size: 18px;
    }

    #mdr-character-input-wrapper h2 {
        font-size: 18px;
    } /* 캐릭터 정보 입력 페이지 */

    .character-summary .server-class, .character-summary .stat-line {
        font-size: 16px;
    }

    #mdr-stats-filters h2 {
        font-size: 18px;
    }
    
    #mdr-character-info-wrapper .equipment-grid {
        grid-template-columns: 1fr;
    }

    #mdr-character-info-wrapper .skill-row.top-row {
        margin-left: 20px;
    }

    /* --- Rune Stats Page --- */
    .page-id-99 #mdr-content {
        max-width: 100%;
    }
    
    #mdr-stats-filters {
        width: 100%;
        padding: 10px;
    }
    .mdr-period-filter-wrapper {
        gap: 5px;
    }
    #mdr-stats-content {
        overflow-x: hidden; /* Prevent horizontal scroll */
    }
    #mdr-stats-content .mdr-stats-grid {
        grid-template-columns: 1fr; /* Single column layout */
    }
    /* Adjust item name inside the card to prevent overflow */
    #mdr-stats-content .mdr-item-name {
        word-break: break-all;
        width: 120px;
    }

    #mdr-rune-stats-wrapper {
        max-width: 100%;
        padding-left: 5px;
        padding-right: 5px;
        margin: 0;
    }

    /* --- Footer --- */
    .mdr-footer-links {
        gap: 5px;
    }

    /* --- 이용안내 페이지 --- */
    body.page-id-83 .page-content h2.wp-block-heading {
        font-size: 18px;
        margin: 40px 0 15px 0;
    }
    
    body.page-id-83 .page-content p {
        margin-bottom: 15px;
    }
}
/* ==========================================================================
   Navigation Menu Styles (Desktop & Mobile)
   ========================================================================== */
.mdr-nav ul li {
    position: relative; /* Needed for desktop dropdown positioning */
}

.mdr-nav ul .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mdr-nav ul .sub-menu li a {
    display: block;
    box-sizing: border-box;
    width: 100%;
}

/* --- Desktop Dropdown Styles --- */
@media (min-width: 1025px) {
    .mdr-nav ul .sub-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--card-background);
        border: 1px solid var(--border-color);
        border-top: none;
        min-width: 200px;
        z-index: 1000;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        border-radius: 0 0 4px 4px;
    }

    .mdr-nav ul li:hover > .sub-menu {
        display: block;
    }

    .mdr-nav ul .sub-menu li a {
        padding: 12px 15px;
        font-size: 16px;
        color: var(--text-color);
        border-bottom: 1px solid var(--border-color);
        text-align: left;
        transition: background-color 0.2s, color 0.2s;
    }

    .mdr-nav ul .sub-menu li:last-child a {
        border-bottom: none;
    }

    .mdr-nav ul .sub-menu li a:hover {
        background-color: var(--table-row-even-bg);
        color: var(--link-hover-color);
    }
}
