* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'ヒラギノ角ゴ Pro', 'ヒラギノ角ゴ ProN', メイリオ, Meiryo;
    line-height: 1.8;
    color: #5a3a2a;
    background: linear-gradient(135deg, #fff8f3 0%, #ffe8d6 100%);
    background-attachment: fixed;
    min-height: 100vh;
    transition: background-color 0.3s ease, background-image 0.3s ease, color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    body {
        color: #d4c5b9;
        background: linear-gradient(135deg, #1a1410 0%, #2d2217 100%);
    }
}

.label {
    display: inline;
}

.shortLabel {
    display: none;
}

.title {
    display: inline;
}

.short-title {
    display: none;
}

@media (max-width: 768px) {
    .label {
        display: none;
    }
    .shortLabel {
        display: inline;
    }
    .title {
        display: none;
    }
    .short-title {
        display: inline;
    }
}

.container {
    max-width: 1400px;
    margin: 30px auto;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(232, 153, 127, 0.2);
    border: 1px solid rgba(232, 160, 100, 0.3);
    animation: fadeIn 0.5s ease-in;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .container {
        background-color: rgba(32, 24, 18, 0.9);
        box-shadow: 0 4px 15px rgba(228, 128, 80, 0.15);
        border: 1px solid rgba(228, 128, 80, 0.2);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#error-banner {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 16px 24px;
    border-radius: 0 0 4px 4px;
    color: #721c24;
    font-weight: bold;
    z-index: 10000;
    min-width: 300px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.5s ease-in, slideUp 0.5s ease-in 4.5s forwards;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
}

h1 {
    color: #d97037;
    border-bottom: 3px solid #f0935f;
    padding-bottom: 15px;
    margin-bottom: 30px;
    font-size: 2.2em;
    font-weight: 700;
    transition: color 0.3s ease, border-color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    h1 {
        color: #e8996f;
        border-bottom: 3px solid #c85a1a;
    }
}

h2 {
    color: #c85a1a;
    border-left: 5px solid #e8a97f;
    padding-left: 15px;
    margin-top: 35px;
    margin-bottom: 20px;
    font-size: 1.6em;
    font-weight: 600;
    transition: color 0.3s ease, border-left-color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    h2 {
        color: #d9a373;
        border-left: 5px solid #c85a1a;
    }
}

h2 a {
    color: #c85a1a;
    text-decoration: none;
    transition: text-decoration 0.3s ease, color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    h2 a {
        color: #d9a373;
    }
}

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

h3 {
    color: #e8996f;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3em;
    transition: color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    h3 {
        color: #d9a373;
    }
}

p {
    color: #5a3a2a;
    margin-bottom: 15px;
    line-height: 1.9;
    transition: color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    p {
        color: #d4c5b9;
    }
}

strong {
    color: #e8996f;
    font-weight: 600;
    transition: color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    strong {
        color: #d9a373;
    }
}

strong a {
    color: #e8996f;
    text-decoration: none;
    transition: text-decoration 0.3s ease, color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    strong a {
        color: #d9a373;
    }
}

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

strong.red {
    color: #dc2626;
}

@media (prefers-color-scheme: dark) {
    strong.red {
        color: #fca5a5;
    }
}

ul, ol {
    margin-left: 30px;
    margin-bottom: 20px;
}

li {
    color: #5a3a2a;
    margin-bottom: 10px;
    line-height: 1.8;
    transition: color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    li {
        color: #d4c5b9;
    }
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav li {
    margin: 12px 0;
}

.tree-icon {
    color: #5a3a2a;
    transition: color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .tree-icon {
        color: #d4c5b9;
    }
}

nav a {
    color: #d97037;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05em;
    padding: 8px 12px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: inline-block;
    margin-right: 8px;
}

@media (prefers-color-scheme: dark) {
    nav a {
        color: #d9a373;
    }
}

nav a:hover {
    background-color: #ffe8d6;
    color: #d97037;
    transform: translateX(5px);
    transition: all 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    nav a:hover {
        background-color: rgba(228, 128, 80, 0.2);
        color: #d9a373;
    }
}

a.disabled {
    pointer-events: none;
    cursor: default;
    opacity: 0.5;
}

code {
    background-color: #ecf0f1;
    color: #c0392b;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    transition: background-color 0.3s ease, color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    code {
        background-color: #3a2f28;
        color: #e8996f;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

table th {
    background-color: #34495e;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    table th {
        background-color: #5a4033;
        color: #f5f5f5;
    }
}

table td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
    transition: border-color 0.3s ease;
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    table td {
        border-bottom: 1px solid #5a4033;
        color: #d4c5b9;
    }
}

.achievements {
    border: 1px solid #ecf0f1;
}

@media (prefers-color-scheme: dark) {
    .achievements {
        border-color: #5a4033;
    }
}

.achievements td:nth-child(1) {
    width: 6%;
    text-align: right;
    border-right: 1px solid #ecf0f1;
}

@media (prefers-color-scheme: dark) {
    .achievements td:nth-child(1) {
        border-right-color: #5a4033;
    }
}

.achievements td:nth-child(2) {
    width: 7%;
    text-align: right;
    border-right: 1px solid #ecf0f1;
}

@media (prefers-color-scheme: dark) {
    .achievements td:nth-child(2) {
        border-right-color: #5a4033;
    }
}

.achievements td:nth-child(3) {
    width: 87%;
}

.achievements .date-header {
    text-align: center;
    border-right: 1px solid #ecf0f1;
}

@media (prefers-color-scheme: dark) {
    .achievements .date-header {
        border-right-color: #5a4033;
    }
}

.achievements .content-header {
    text-align: center;
}

.achievements td.no-border {
    border-bottom: none;
}

.achievements a {
    color: inherit;
    text-decoration: none;
    display: block;
    margin: -12px;
    padding: 12px;
    box-sizing: border-box;
    transition: background-color 0.3s ease;
}

.achievements a:hover {
    background-color: #ecf0f1;
}

.achievements a:focus-visible {
    background-color: #ecf0f1;
    outline: 2px solid #d97037;
    outline-offset: -2px;
}

.achievements a.disabled {
    cursor: default;
    pointer-events: none;
}

.achievements a.disabled:hover {
    background-color: transparent;
}

@media (prefers-color-scheme: dark) {
    .achievements a:hover {
        background-color: #3e2723;
    }

    .achievements a:focus-visible {
        background-color: #3e2723;
        outline-color: #d9a373;
    }

    .achievements a.disabled:hover {
        background-color: transparent;
    }
}

.stars {
    display: inline-block;
    font-size: 1.1em;
    letter-spacing: 0.2em;
    font-family: monospace;
}

.stars-disabled {
    opacity: 0.5;
}

.stars[data-rating="0"]::after { content: "☆☆☆☆☆"; }
.stars[data-rating="1"]::after { content: "★☆☆☆☆"; }
.stars[data-rating="2"]::after { content: "★★☆☆☆"; }
.stars[data-rating="3"]::after { content: "★★★☆☆"; }
.stars[data-rating="4"]::after { content: "★★★★☆"; }
.stars[data-rating="5"]::after { content: "★★★★★"; }
.stars[data-rating="6"]::after { content: "★　×　６"; }
.stars[data-rating="7"]::after { content: "★　×　７"; }
.stars[data-rating="8"]::after { content: "★　×　８"; }
.stars[data-rating="9"]::after { content: "★　×　９"; }

@media (max-width: 768px) {
    .container {
        margin: 15px;
        padding: 20px;
    }

    h1 {
        font-size: 1.8em;
    }

    h2 {
        font-size: 1.3em;
    }

    body {
        font-size: 0.95em;
    }

    ul, ol {
        margin-left: 20px;
    }

    .header-content {
        gap: 15px;
    }
}

header {
    background-color: #d97037;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(217, 112, 55, 0.2);
    margin-bottom: 40px;
    width: 100%;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    position: sticky;
    top: 0;
    z-index: 999;
}

@media (prefers-color-scheme: dark) {
    header {
        background-color: #8a5a3a;
        box-shadow: 0 2px 8px rgba(217, 163, 115, 0.2);
    }
}

.header-content {
    max-width: 1400px;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 0 20px;
    margin: 0 auto;
}

.header-title {
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    transition: opacity 0.3s ease;
    margin-right: auto;
}

.header-title:hover {
    opacity: 0.9;
}

.header-title:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    gap: 6px;
    flex-shrink: 0;
}

.hamburger span {
    width: 24px;
    height: 2.5px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
}

.hamburger:hover span {
    background-color: rgba(255, 255, 255, 0.8);
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.header-nav-desktop {
    display: flex;
}

.header-nav-mobile {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    flex-direction: column;
    background-color: #d97037;
    transition: max-height 0.3s ease;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (prefers-color-scheme: dark) {
    .header-nav-mobile {
        background-color: #8a5a3a;
    }
}

.header-nav-mobile.open {
    max-height: 500px;
}

.header-nav-mobile ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 12px 20px;
    margin: 0;
}

.header-nav-mobile li {
    margin: 0;
}

.header-nav-mobile a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1em;
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.header-nav-mobile a:last-child {
    border-bottom: none;
}

.header-nav-mobile a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.header-nav-mobile a:focus-visible {
    outline: 2px solid white;
    outline-offset: -2px;
}

@media (max-width: 767px) {
    .hamburger {
        display: flex;
    }

    .header-nav-desktop {
        display: none;
    }

    .header-nav-mobile {
        display: flex;
    }
}

.header-nav-desktop ul {
    list-style: none;
    display: flex;
    gap: 30px;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.header-nav-desktop a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 5px;
}

.header-nav-desktop a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
}

.header-nav-desktop a:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

footer {
    background-color: #d97037;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 60px;
    font-size: 0.95em;
    width: 100%;
    transition: background-color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    footer {
        background-color: #8a5a3a;
    }
}

footer p {
    color: white;
    margin: 0;
}

.footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.footer-links {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 1.5em;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
}

.footer-links a:hover {
    transform: translateY(-3px);
    background-color: rgba(255, 255, 255, 0.2);
}

.sitemap {
    margin-left: 20px;
}

.sitemap li {
    margin-bottom: 15px;
    margin-top: 10px;
}

.sitemap li:first-child {
    margin-top: 15px;
}

.sitemap a {
    color: #d97037;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 600;
}

@media (prefers-color-scheme: dark) {
    .sitemap a {
        color: #d9a373;
    }
}

.sitemap a:hover {
    color: #e8996f;
    text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
    .sitemap a:hover {
        color: #e8b89f;
    }
}

.stage-selector {
    display: flex;
    gap: 8px;
    margin: 0 0 12px 0;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 0;
}

.stage-arrow {
    padding: 4px 8px;
    border: none;
    background-color: transparent;
    color: #d97037;
    border-radius: 0;
    cursor: pointer;
    font-weight: 600;
    transition: color 0.2s ease;
    font-size: 1em;
    min-width: auto;
}

.stage-arrow:hover {
    color: #c85a1a;
    background-color: transparent;
    box-shadow: none;
    transform: none;
}

.stage-arrow:focus-visible {
    outline: 2px solid #d97037;
    outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
    .stage-arrow {
        color: #d9a373;
    }

    .stage-arrow:hover {
        color: #e8b896;
        background-color: transparent;
        box-shadow: none;
    }

    .stage-arrow:focus-visible {
        outline-color: #d9a373;
    }

    .stage-selector {
        border-bottom-color: #5a4033;
    }
}

#stage-dropdown {
    padding: 4px 8px;
    border: none;
    background-color: transparent;
    color: #d97037;
    border-radius: 0;
    cursor: pointer;
    font-weight: 600;
    transition: color 0.2s ease;
    font-size: 1em;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none;
    text-align: center;
}

#stage-dropdown:hover {
    color: #c85a1a;
    border: none;
}

#stage-dropdown:focus-visible {
    outline: 2px solid #d97037;
    outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
    #stage-dropdown {
        background-color: transparent;
        color: #d9a373;
    }

    #stage-dropdown:hover {
        color: #e8b896;
    }

    #stage-dropdown:focus-visible {
        outline-color: #d9a373;
    }

    #stage-dropdown option {
        background-color: #3a2f28;
        color: #d9a373;
    }
}

.video-container {
    display: flex;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.video-panel,
.timestamps-panel,
.content-panel {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fafafa;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .video-panel,
    .timestamps-panel,
    .content-panel {
        background-color: #3a2f28;
        border-color: #5a4033;
    }
}

.video-panel {
    flex: 2;
    min-width: 300px;
    align-self: center;
}

.video-wrapper {
    aspect-ratio: 4 / 3;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-wrapper iframe {
    border: none;
    border-radius: 4px;
    width: 100%;
    height: 100%;
}

.timestamps-panel {
    flex: 1;
    min-width: 200px;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.timestamps-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 15px 15px 15px;
}

.timestamps-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.timestamps-list li {
    margin: 8px 0;
}

.timestamp {
    color: #d97037;
    text-decoration: none;
    padding: 8px;
    display: block;
    border-radius: 4px;
    transition: background-color 0.2s;
    background-color: #f0f0f0;
    cursor: pointer;
    font-weight: 500;
}

@media (prefers-color-scheme: dark) {
    .timestamp {
        background-color: #5a4033;
        color: #d9a373;
    }
}

.timestamp:hover {
    background-color: #e8e8e8;
}

@media (prefers-color-scheme: dark) {
    .timestamp:hover {
        background-color: #6b5541;
    }
}

.timestamp:focus {
    outline: 2px solid #d97037;
    outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
    .timestamp:focus {
        outline-color: #d9a373;
    }
}

.content-panel {
    margin-top: 20px;
}

.stamp h3 {
    margin-top: 0;
    color: #d97037;
    border-bottom: 2px solid #d97037;
    padding-bottom: 10px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .stamp h3 {
        color: #d9a373;
        border-bottom-color: #c85a1a;
    }
}

.stamp.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }

    h1 {
        font-size: 1.6em;
        margin-bottom: 15px;
    }

    h2 {
        font-size: 1.2em;
    }

    body {
        font-size: 0.95em;
    }

    .video-container {
        flex-wrap: wrap;
        gap: 10px;
        margin: 15px 0;
    }

    .video-panel,
    .timestamps-panel,
    .content-panel {
        padding: 10px;
        border-radius: 4px;
    }

    .video-panel {
        flex: 1 1 100%;
        min-width: auto;
    }

    .timestamps-panel {
        flex: 1 1 100%;
        min-width: auto;
        overflow: hidden;
    }

    .stage-selector {
        padding: 5px 0;
        margin: 0 0 8px 0;
        gap: 4px;
    }

    .stage-arrow {
        padding: 4px 6px;
        font-size: 1em;
        min-height: 44px;
        min-width: 44px;
    }

    #stage-dropdown {
        padding: 8px;
        font-size: 1em;
        min-height: 44px;
    }

    .timestamps-list {
        padding: 8px 8px 8px 8px;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        flex: 1;
    }

    .timestamps-list.empty {
        justify-content: center;
    }

    .timestamps-list ul {
        display: flex;
        flex-direction: row;
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .timestamps-list li {
        margin: 0 8px 0 0;
    }

    .timestamps-list li.no-timestamps {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
    }

    .timestamp {
        padding: 10px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.9em;
        white-space: nowrap;
        flex-shrink: 0;
        min-width: 80px;
    }

    table {
        font-size: 0.9em;
    }

    table th, table td {
        padding: 8px;
    }

    nav a {
        font-size: 0.95em;
    }
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

@media (prefers-color-scheme: dark) {
    ::-webkit-scrollbar-track {
        background: #1a1410;
    }

    ::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 6px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #aaa;
    }

    .timestamps-list::-webkit-scrollbar-track {
        background: #3a2f28;
    }
}

.info {
    margin: 30px 0;
    border-left: 4px solid #d97037;
    padding: 20px;
    background-color: #f9f9f9;
    transition: background-color 0.3s ease, border-left-color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .info {
        background-color: #2a2a2a;
    }
}

.info h2 {
    margin-top: 0;
    color: #d97037;
    transition: color 0.3s ease;
}

.info ol, .info ul {
    line-height: 1.8;
}

.info li {
    margin: 12px 0;
}

.filter-container {
    display: flex;
    gap: 20px;
    margin: 20px 0 30px 0;
    align-items: flex-end;
    flex-wrap: nowrap;
}

.filter-group {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}

.filter-group:nth-child(1) {
    flex: 0;
}

.filter-group:nth-child(2) {
    flex: 1;
    min-width: 0;
}

#year-select,
#search-input {
    padding: 8px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background-color: white;
    color: #5a3a2a;
    font-size: 0.95em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: inherit;
}

#year-select:hover,
#search-input:hover {
    border-color: #a89080;
}

#year-select:focus,
#search-input:focus {
    outline: none;
    border-color: #d97037;
    box-shadow: 0 0 0 3px rgba(217, 112, 55, 0.1);
}

#year-select {
    min-width: 80px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a3a2a' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 20px;
    padding-right: 32px;
}

@media (prefers-color-scheme: dark) {
    #year-select,
    #search-input {
        background-color: #3a2f28;
        color: #d4c5b9;
        border-color: #5a4033;
    }

    #year-select:hover,
    #search-input:hover {
        border-color: #8a5a3a;
    }

    #year-select:focus,
    #search-input:focus {
        border-color: #d9a373;
        box-shadow: 0 0 0 3px rgba(217, 163, 115, 0.1);
    }

    #year-select {
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d4c5b9' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    }

    #year-select option {
        background-color: #3a2f28;
        color: #d4c5b9;
    }
}

#search-input {
    flex: 1;
    min-width: 0;
}

#search-input::placeholder {
    color: rgba(90, 58, 42, 0.5);
}

@media (prefers-color-scheme: dark) {
    #search-input::placeholder {
        color: rgba(212, 197, 185, 0.5);
    }
}

@media (max-width: 768px) {
    .filter-container {
        flex-direction: row;
        gap: 10px;
        flex-wrap: nowrap;
    }

    .filter-group:nth-child(1) {
        flex: 0;
    }

    .filter-group:nth-child(2) {
        flex: 1;
        min-width: 0;
    }

    #year-select {
        width: auto;
    }

    #search-input {
        width: 100%;
    }
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

@media (prefers-color-scheme: dark) {
    .no-results {
        color: #999;
    }
}



#scroll-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #dd7e4b;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#scroll-btn:hover {
    background-color: #e28559;
    transform: translateY(-3px);
}

#scroll-btn.visible {
    opacity: 1;
    visibility: visible;
}

@media (prefers-color-scheme: dark) {
    #scroll-btn {
        background-color: #996b4e;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    #scroll-btn:hover {
        background-color: #a87c5f;
    }
}

.note {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px;
    margin: 15px 0;
    border-radius: 4px;
    transition: background-color 0.3s ease, border-left-color 0.3s ease, color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .note {
        background-color: #5a4033;
        border-left-color: #d9a373;
        color: #f0e6d8;
    }
}

.character-label-full {
    display: inline;
}

.character-label-short {
    display: none;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.button-group .btn {
    display: flex;
}

.button-group .btn-hero {
    flex: 1 1 0;
    max-width: 300px;
}

.btn-primary {
    background-color: #a89080;
    color: white;
}

.btn-primary:hover {
    background-color: #998574;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 144, 128, 0.3);
}

.btn-primary:focus-visible {
    outline: 2px solid #a89080;
    outline-offset: 2px;
}

.btn-secondary {
    background-color: #a0a0a0;
    color: white;
}

.btn-secondary:hover {
    background-color: #909090;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(160, 160, 160, 0.3);
}

.btn-secondary:focus-visible {
    outline: 2px solid #a0a0a0;
    outline-offset: 2px;
}

.btn-hero {
    padding: 24px 48px;
    font-size: 1.3em;
    margin: 15px;
}

@media (prefers-color-scheme: dark) {
    .btn-primary {
        background-color: #6b6158;
        color: white;
    }

    .btn-primary:hover {
        background-color: #7a6f64;
        box-shadow: 0 4px 12px rgba(107, 97, 88, 0.3);
    }

    .btn-primary:focus-visible {
        outline-color: #6b6158;
    }

    .btn-secondary {
        background-color: #707070;
        color: white;
    }

    .btn-secondary:hover {
        background-color: #808080;
        box-shadow: 0 4px 12px rgba(112, 112, 112, 0.3);
    }

    .btn-secondary:focus-visible {
        outline-color: #707070;
    }
}

@media (max-width: 768px) {
    .button-group {
        gap: 10px;
    }

    .btn {
        padding: 14px 20px;
        font-size: 1em;
        flex: 1 1 calc(50% - 5px);
    }

    .btn-hero {
        flex: 1 1 auto;
        padding: 16px 24px;
        font-size: 1.1em;
        margin: 10px;
    }

    .character-label-full {
        display: none;
    }

    .character-label-short {
        display: inline;
    }
}

#recent-achievements {
    list-style: none;
    padding: 0;
    margin: 0;
}

#recent-achievements li {
    margin: 0 0 12px 0;
    padding: 0;
}

#recent-achievements a {
    display: block;
    padding: 16px;
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #5a3a2a;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: pre-line;
    line-height: 1.6;
}

#recent-achievements a.recent-achievement-new {
    background-color: #fff4e6;
    border-color: #ffd9b3;
}

#recent-achievements a:hover {
    background-color: #f0f0f0;
    border-color: #d97037;
    box-shadow: 0 2px 8px rgba(217, 112, 55, 0.2);
    transform: translateY(-2px);
}

#recent-achievements a.no-link:hover {
    background-color: #fafafa;
    border-color: #e0e0e0;
    box-shadow: none;
    transform: none;
}

#recent-achievements a.no-link.recent-achievement-new:hover {
    background-color: #fff4e6;
    border-color: #ffd9b3;
}

#recent-achievements a.recent-achievement-new:hover {
    background-color: #ffebcc;
    border-color: #d97037;
}

#recent-achievements a:focus-visible {
    outline: 2px solid #d97037;
    outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
    #recent-achievements a {
        background-color: #3a2f28;
        border-color: #5a4033;
        color: #d4c5b9;
    }

    #recent-achievements a.recent-achievement-new {
        background-color: #4a3e30;
        border-color: #8a6f4a;
    }

    #recent-achievements a:hover {
        background-color: #4a4038;
        border-color: #d9a373;
        box-shadow: 0 2px 8px rgba(217, 163, 115, 0.2);
    }

    #recent-achievements a.no-link:hover {
        background-color: #3a2f28;
        border-color: #5a4033;
        box-shadow: none;
    }

    #recent-achievements a.no-link.recent-achievement-new:hover {
        background-color: #4a3e30;
        border-color: #8a6f4a;
    }

    #recent-achievements a.recent-achievement-new:hover {
        background-color: #5a4d3a;
        border-color: #d9a373;
    }

    #recent-achievements a:focus-visible {
        outline-color: #d9a373;
    }
}