/* das-gaming.com/asset/css/style.css */
/* --- Base Reset & Colors --- */
:root {
    --color-bg: #000000;
    --color-text: #ffffff;
    --color-text-dark: #888888;
    --color-accent-orange: #ff5500;
    --color-accent-indigo: #1a237e;
}

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

body,
html {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: var(--color-bg);
    font-family: 'Teko', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* --- Background Canvas --- */
#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* 走査線 + ノイズ + 色味 */
    background:
        radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 0),
        linear-gradient(rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.4) 50%),
        radial-gradient(circle at center, rgba(26, 35, 126, 0.15) 0%, #000000 100%);
    background-size: 3px 3px, 100% 4px, 100% 100%;
    transition: all 0.5s ease;
}


/* --- Content Container --- */
.container {
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    padding: 2rem 0 4rem;
    /* Unify bottom spacing to 4rem */
    pointer-events: none;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
}

/* Dark Mode: Warp Effect */
body.warping #starfield {
    background-color: rgba(26, 35, 126, 0.3);
    box-shadow: inset 0 0 150px rgba(255, 85, 0, 0.4);
}

.container.warping {
    transform: scale(0.9) translateZ(-50px);
    opacity: 0.8;
    animation: text-shake 0.1s infinite;
}

@keyframes text-shake {
    0% {
        transform: scale(0.9) translateZ(-50px) translate(1px, 1px);
    }

    50% {
        transform: scale(0.9) translateZ(-50px) translate(-1px, -2px);
    }

    100% {
        transform: scale(0.9) translateZ(-50px) translate(0px, 1px);
    }
}

/* --- Grunge Text Mixin --- */
.text-grunge {
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    background-image:
        repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.8) 0px, transparent 1px),
        repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.3) 0px, transparent 2px, rgba(255, 255, 255, 0.1) 4px),
        linear-gradient(to bottom, var(--color-text) 30%, var(--color-text-dark) 100%);
    background-size: 4px 4px, 6px 6px, 100% 100%;
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.2));
}

/* --- Brand Name --- */
.brand-name {
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 300;
    letter-spacing: 0.5em;
    margin-bottom: 2rem;
    margin-top: 4rem;
    /* Add top margin */
    opacity: 0.9;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    background-image:
        repeating-linear-gradient(90deg, #ff6f00 0%, #ffca28 50%, #ff6f00 100%),
        repeating-radial-gradient(circle, rgba(255, 255, 255, 0.3) 1px, transparent 2px);
    background-size: 100% 100%, 3px 3px;
    text-shadow: 0 0 10px rgba(255, 111, 0, 0.6);
    filter: drop-shadow(0 0 5px rgba(255, 111, 0, 0.6));
}

/* --- Main Title Wrapper (枠線削除) --- */
.glitch-wrapper {
    position: relative;
    padding: 1rem;
    /* 余白のみ */
}

.glitch-text {
    font-size: clamp(4rem, 15vw, 10rem);
    font-weight: 600;
    line-height: 0.9;
    position: relative;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.glitch-text-base {
    position: relative;
    z-index: 2;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.8;
}

/* Layer 1: Red/Orange Shift */
.glitch-text::before {
    left: 3px;
    color: var(--color-accent-orange);
    background: repeating-linear-gradient(transparent 0px, rgba(0, 0, 0, 0.5) 2px);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 2px 0 rgba(255, 0, 0, 0.5);
    clip-path: inset(24% 0 29% 0);
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

/* Layer 2: Blue/Indigo Shift */
.glitch-text::after {
    left: -3px;
    color: var(--color-accent-indigo);
    background: repeating-linear-gradient(transparent 0px, rgba(0, 0, 0, 0.5) 3px);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: -2px 0 rgba(0, 0, 255, 0.5);
    clip-path: inset(54% 0 21% 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

/* --- Footer Info --- */
.footer-info {
    margin-top: auto;
    /* Push to bottom in flex container */
    padding-bottom: 2rem;
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.4);
    background-image: radial-gradient(rgba(0, 0, 0, 0.8) 1px, transparent 0);
    background-size: 2px 2px;
    -webkit-background-clip: text;
    background-clip: text;
    z-index: 20;
    pointer-events: auto;
    position: relative;
    /* Change from absolute to relative flow */
    bottom: auto;
}

/* --- Animations --- */
@keyframes glitch-anim-1 {
    0% {
        clip-path: inset(40% 0 61% 0);
    }

    20% {
        clip-path: inset(92% 0 1% 0);
    }

    40% {
        clip-path: inset(43% 0 1% 0);
    }

    60% {
        clip-path: inset(25% 0 58% 0);
    }

    80% {
        clip-path: inset(54% 0 7% 0);
    }

    100% {
        clip-path: inset(58% 0 43% 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip-path: inset(24% 0 29% 0);
    }

    20% {
        clip-path: inset(54% 0 21% 0);
    }

    40% {
        clip-path: inset(11% 0 24% 0);
    }

    60% {
        clip-path: inset(22% 0 55% 0);
    }

    80% {
        clip-path: inset(62% 0 16% 0);
    }

    100% {
        clip-path: inset(93% 0 3% 0);
    }
}

@media (max-width: 768px) {
    .brand-name {
        letter-spacing: 0.2em;
    }

    .glitch-text {
        letter-spacing: 0.02em;
    }
}

/* --- New Layout Styles --- */

.site-header {
    margin-bottom: 2rem;
    z-index: 10;
}

.site-footer {
    margin-top: auto;
    padding: 1rem;
    z-index: 20;
    /* Increased to ensure visibility */
    position: relative;
    /* Fix z-index issue */
    width: 100%;
}

.footer-links {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: center;
    gap: 1rem;
    align-items: center;
    pointer-events: auto;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--color-accent-orange);
}

.card-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 1200px;
    padding: 1rem;
    z-index: 10;
    /* For Drag and Drop context */
    min-height: 50vh;
}

.card {
    width: 280px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
    user-select: none;
    position: relative;
    /* For absolute positioning if we go full free-drag later, but flex is safer for basic flow + reorder */
    touch-action: none;
    /* Important for Pointer Events */
    pointer-events: auto;
}

.card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-accent-orange);
    box-shadow: 0 0 15px rgba(255, 85, 0, 0.2);
    transform: translateY(-2px);
}

.card:active {
    cursor: grabbing;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-accent-orange);
    pointer-events: none;
}

.card-desc {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.4;
    pointer-events: none;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-window {
    width: 90%;
    height: 80%;
    max-width: 1000px;
    background: #000;
    border: 1px solid var(--color-accent-indigo);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(26, 35, 126, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-window {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(26, 35, 126, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    font-size: 1.2rem;
    color: var(--color-text);
}

.modal-controls {
    display: flex;
    gap: 0.5rem;
}

.modal-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}

.modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #000;
    /* Dark mode default, overridden in style-light.css */
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 600px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .breadcrumb .current {
        max-width: 150px;
    }
}

/* === Filter Bar === */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    width: 100%;
    max-width: 1200px;
    z-index: 10;
    pointer-events: auto;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Teko', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, rgba(255, 85, 0, 0.3), rgba(26, 35, 126, 0.3));
    border-color: var(--color-accent-orange);
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 85, 0, 0.3);
}

.filter-icon {
    font-size: 1.1rem;
}

.filter-label {
    letter-spacing: 0.05em;
}

/* === Card Tag Badges === */
.card-tags {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.3rem;
    pointer-events: none;
}

.tag-badge {
    font-size: 0.8rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.card:hover .tag-badge {
    opacity: 1;
}

/* === Empty State === */
.no-tools {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    padding: 3rem;
    text-align: center;
}

/* === Drag Over State === */
.card.over {
    border-color: var(--color-accent-orange);
    box-shadow: 0 0 20px rgba(255, 85, 0, 0.4);
}

.card.dragging {
    opacity: 0.4;
}

/* === Responsive Filter Bar === */
@media (max-width: 600px) {
    .filter-bar {
        gap: 0.3rem;
        padding: 0.5rem;
    }

    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .filter-label {
        display: none;
    }

    .filter-btn.active .filter-label {
        display: inline;
    }
}

/* === Theme Toggle Button === */
.theme-toggle-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    color: #ffffff;
    /* SVG stroke color */
}

.theme-toggle-btn svg {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.theme-toggle-btn:hover {
    background: rgba(255, 85, 0, 0.3);
    border-color: var(--color-accent-orange);
    transform: scale(1.1);
}

/* Light theme adjustments for toggle button */
body.theme-light .theme-toggle-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 96, 100, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: #006064;
    /* SVG stroke color for light theme */
}

body.theme-light .theme-toggle-btn:hover {
    background: rgba(255, 111, 0, 0.15);
    border-color: var(--color-accent-orange);
    color: var(--color-accent-orange);
}

/* === Language Toggle Button === */
.lang-toggle-btn {
    position: fixed;
    top: 1rem;
    right: 4.5rem;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-size: 1.4rem;
    font-family: 'Teko', sans-serif;
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 1;
    padding: 0;
    color: #ffffff;
}

.lang-toggle-btn:hover {
    background: rgba(255, 85, 0, 0.3);
    border-color: var(--color-accent-orange);
    transform: scale(1.1);
}

/* Light theme adjustments for language toggle button */
body.theme-light .lang-toggle-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 96, 100, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: #006064;
}

body.theme-light .lang-toggle-btn:hover {
    background: rgba(255, 111, 0, 0.15);
    border-color: var(--color-accent-orange);
}

/* === Back to Top Button (Styled like error.php .error-link) === */
.back-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 900;

    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;

    font-family: 'Teko', sans-serif;
    font-size: 1.2rem;
    color: var(--color-accent-orange);
    border: 2px solid var(--color-accent-orange);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    overflow: hidden;

    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 85, 0, 0.3), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.back-to-top-btn:hover::before {
    left: 100%;
}

.back-to-top-btn:hover {
    background: var(--color-accent-orange);
    color: #000;
    box-shadow: 0 0 20px rgba(255, 85, 0, 0.5);
    transform: translateY(-3px);
}

.back-to-top-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform 0.3s ease;
}

.back-to-top-btn:hover svg {
    transform: translateY(-3px);
}

/* Light theme for back to top */
body.theme-light .back-to-top-btn {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.2);
    color: var(--color-text-dark);
}

body.theme-light .back-to-top-btn:hover {
    background: var(--color-accent-orange);
    border-color: var(--color-accent-orange);
    color: #fff;
}

/* === Return to Home Button (Clone of error.php .error-link) === */
.return-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2.5rem;
    font-family: 'Teko', sans-serif;
    font-size: 1.3rem;
    color: var(--color-accent-orange);
    border: 2px solid var(--color-accent-orange);
    text-decoration: none;
    letter-spacing: 0.15em;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    margin-top: 0;
}

.return-home-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 85, 0, 0.3), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.return-home-btn:hover::before {
    left: 100%;
}

.return-home-btn:hover {
    background: var(--color-accent-orange);
    color: #000;
    box-shadow: 0 0 20px rgba(255, 85, 0, 0.5);
}

.return-home-btn svg {
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform 0.3s ease;
}

.return-home-btn:hover svg {
    transform: translateX(-5px);
}

/* Light theme support */
body.theme-light .return-home-btn {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.2);
    color: var(--color-text-dark);
}

body.theme-light .return-home-btn:hover {
    background: var(--color-accent-orange);
    border-color: var(--color-accent-orange);
    color: #fff;
}

/* === Site About Section (SEO Content) === */
.site-about {
    width: 100%;
    max-width: 1000px;
    padding: 2rem 1rem;
    margin-top: 2rem;
    z-index: 10;
    pointer-events: auto;
}

.about-card {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 2rem;
    text-align: left;
}

.about-card h2 {
    font-size: 1.5rem;
    color: var(--color-accent-orange);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.about-card p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.about-card p:last-child {
    margin-bottom: 0;
}

/* Light theme for site-about */
body.theme-light .about-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}

body.theme-light .about-card p {
    color: rgba(0, 0, 0, 0.8);
}

/* === Card as anchor tag (SSR support) === */
a.card {
    text-decoration: none;
    color: inherit;
    display: block;
}

a.card:visited {
    color: inherit;
}