﻿:root {
    --bg: #0b0d13;
    --bg-secondary: #131826;
    --accent: #ff6b35;
    --accent-soft: rgba(255, 107, 53, 0.2);
    --text: #f5f2eb;
    --muted: #b6b1a8;
    --card: rgba(18, 22, 32, 0.86);
    --stroke: rgba(255, 255, 255, 0.08);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Nanum Gothic", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
    background-color: #0b0d13;
    background-image:
        linear-gradient(rgba(6, 8, 12, 0.82), rgba(6, 8, 12, 0.9)),
        url("https://pbs.twimg.com/media/GtkQCi8aEAA9k2q.jpg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    padding: 16px 12px 24px;
    position: relative;
    overflow-x: hidden;
}

.bg-orb {
    position: absolute;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.3), rgba(255, 107, 53, 0));
    filter: blur(10px);
    z-index: 0;
}

.orb-1 {
    top: -120px;
    right: -120px;
}

.orb-2 {
    bottom: -140px;
    left: -120px;
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.22;
    pointer-events: none;
    z-index: 0;
}

.site-header {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 auto 14px;
    max-width: 860px;
}

.brand h1 {
    font-family: "Black Han Sans", "Nanum Gothic", sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    margin: 2px 0 3px;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
    letter-spacing: -0.5px;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from {
        filter: drop-shadow(0 0 2px rgba(255, 107, 53, 0.4));
    }

    to {
        filter: drop-shadow(0 0 10px rgba(255, 107, 53, 0.8));
    }
}

.brand-sub {
    margin: 0;
    color: var(--muted);
    font-size: 0.76rem;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.layout {
    position: relative;
    z-index: 1;
    max-width: 860px;
    margin: 0 auto;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    padding: 12px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.card-header h2 {
    margin: 0 0 5px;
    font-size: 1rem;
}

.card-header p {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.78rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.76rem;
    color: var(--muted);
}

.field input,
.field select {
    background: var(--bg-secondary);
    border: 1px solid var(--stroke);
    border-radius: 8px;
    padding: 7px 9px;
    color: var(--text);
    font-size: 0.8rem;
}

.search-form,
.combo-form,
.login-form {
    display: grid;
    gap: 7px;
}

.primary-button,
.ghost-button {
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 7px 12px;
    font-weight: 600;
    font-size: 0.76rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button {
    background: var(--accent);
    color: #18130e;
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
}

.ghost-button {
    background: transparent;
    color: var(--text);
    border-color: var(--stroke);
}

.primary-button:hover,
.ghost-button:hover {
    transform: translateY(-1px);
}

.empty-box {
    margin-top: 8px;
    padding: 10px;
    border-radius: 9px;
    border: 1px dashed var(--stroke);
    color: var(--muted);
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.78rem;
}

.combo-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: grid;
    gap: 8px;
}

.combo-item {
    background: var(--bg-secondary);
    border: 1px solid var(--stroke);
    border-radius: 9px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.combo-item span {
    color: var(--muted);
    font-size: 0.74rem;
}

.combo-empty {
    color: var(--muted);
    padding: 8px;
    border: 1px dashed var(--stroke);
    border-radius: 10px;
    text-align: center;
    font-size: 0.76rem;
}

.hint {
    color: var(--muted);
    font-size: 0.74rem;
    margin-top: 7px;
}

.site-footer {
    position: relative;
    z-index: 1;
    max-width: 860px;
    margin: 14px auto 0;
    color: var(--muted);
    text-align: center;
    font-size: 0.72rem;
}

.latest-routes {
    margin-top: 20px;
}

.latest-routes h3 {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: var(--muted);
}

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

.route-card {
    background: #fff;
    border: 1px solid var(--stroke);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.character-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.char-img-placeholder {
    width: 40px;
    height: 40px;
    background-color: #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: #333;
    overflow: hidden;
}

.char-name {
    font-weight: bold;
    font-size: 0.9rem;
    color: #333;
}

.item-list {
    display: flex;
    gap: 4px;
}

.item-placeholder {
    width: 32px;
    height: 32px;
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #555;
}

/* Dark mode adjustments if needed based on root variables */
.route-card {
    background: var(--bg-secondary);
    border-color: var(--stroke);
}

.char-name {
    color: var(--text);
}

.char-img-placeholder {
    background-color: var(--stroke);
    color: var(--text);
}

.item-placeholder {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--stroke);
    color: var(--muted);
}

.stats-table-container {
    overflow-x: auto;
    margin-top: 10px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    color: var(--text);
}

.stats-table th,
.stats-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--stroke);
}

.stats-table th {
    color: var(--muted);
    font-weight: normal;
    font-size: 0.75rem;
}

.character-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-footer {
    margin-top: 10px;
    font-size: 0.7rem;
    color: var(--muted);
    text-align: right;
}

@media (max-width: 720px) {
    body {
        padding: 12px 9px 18px;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .routes-grid {
        grid-template-columns: 1fr;
    }
}

/* Match History Card Styles */
.game-record-card {
    background: var(--bg-secondary);
    border: 1px solid var(--stroke);
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.game-record-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.game-record-card.game-win {
    border-left: 4px solid var(--accent);
}

.game-record-card.game-loss {
    border-left: 4px solid #555;
}

.char-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid var(--stroke);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.char-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.char-fallback {
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
    word-break: keep-all;
    line-height: 1.2;
    font-weight: bold;
}

.game-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.game-summary .rank {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.game-summary .rank.win-text {
    color: var(--accent);
}

.first-place-text {
    color: #4CAF50 !important;
}

.first-place-card {
    border-left-color: #4CAF50 !important;
}

.game-summary .stats {
    font-size: 0.85rem;
    color: var(--muted);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.cobalt-mode.game-win {
    border-left-color: #4CAF50;
    /* Add a distinct green for Cobalt Win if preferred */
}

.cobalt-mode .win-text {
    color: #4CAF50;
}
/* Radar Chart Styles */
.chart-container {
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.chart-container.hidden {
    display: none !important;
}
.hidden {
    display: none !important;
}

/* Side-by-Side Search Layout */
.search-view-wrapper {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    align-items: flex-start;
}

.search-view-wrapper .chart-container {
    flex: 0 0 320px;
    margin-bottom: 0;
}

.search-view-wrapper #search-result {
    flex: 1;
    margin-top: 0;
    min-height: 400px;
}

@media (max-width: 800px) {
    .search-view-wrapper {
        flex-direction: column;
    }
    .search-view-wrapper .chart-container {
        flex: 1 0 auto;
        width: 100%;
    }
}
