:root {
    --bg-color: #050505;
    /* Cyber Dark */
    --text-primary: #e0e0e0;
    --text-secondary: #00ff9d;
    /* Cyber Green */
    --accent-color: #00f3ff;
    /* Cyan Neon */
    --accent-gradient: linear-gradient(90deg, #00f3ff 0%, #bc13fe 100%);
    /* Cyan to Purple */
    --gold-gradient: linear-gradient(135deg, #ffd700 0%, #ff9500 100%);
    --card-bg: rgba(10, 20, 30, 0.85);
    /* Darker, less transparent */
    --border-color: #00f3ff;
    /* Neon Border */
    --glass-blur: 4px;
    --font-main: 'Orbitron', 'Inter', sans-serif;
    --font-pixel: 'Press Start 2P', cursive;
    --scanline-color: rgba(0, 255, 0, 0.05);
    --cursor-color: #00f3ff;
    --text-gradient: linear-gradient(135deg, #00f3ff 0%, #bc13fe 100%);
}

/* Hide scrollbar for Chrome, Safari and Opera */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
html {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body {
    cursor: crosshair;
    /* Fallback */
}

/* Custom Cursor */
.custom-cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--cursor-color);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
    mix-blend-mode: difference;
    opacity: 1;
}

@media (hover: none) {
    .custom-cursor {
        opacity: 0;
        visibility: hidden;
    }
}

.custom-cursor.hovered {
    width: 40px;
    height: 40px;
    background-color: rgba(0, 243, 255, 0.2);
    border-color: #bc13fe;
}

.custom-cursor::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: var(--cursor-color);
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    letter-spacing: 0.05em;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    /* Hide scrollbar for IE, Edge and Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
    background-image: linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Scanline Effect */
body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 9999;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(2deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

/* Performance Utilities */
.award-card,
.magnet-button,
.app-icon,
.iphone-frame {
    will-change: transform;
}

/* Ambient Background - Adjusted for Cyberpunk */
.ambient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -2;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, rgba(0, 40, 60, 0.2) 0%, transparent 80%);
}

#bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0.6;
}

.ambient-background::before {
    display: none;
}

/* Random Lights */
.random-light {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    filter: blur(20px);
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    animation: flash 4s ease-in-out forwards;
}

@keyframes flash {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    50% {
        opacity: 0.3;
        transform: scale(1.2);
    }

    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* Scroll Line (Subtle) */
.scroll-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--accent-gradient);
    z-index: 10002;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px var(--accent-color), 0 0 5px rgba(0, 243, 255, 0.5);
    opacity: 1;
}

/* --- Unified Header & Navigation Section --- */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 40px;
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(0, 0, 0, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

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

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* Global EXP HUD - Integrated into Header */
.exp-hud {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 6px 15px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    font-family: 'Orbitron', sans-serif;
    margin: 0 20px;
    flex: 1;
    max-width: 400px;
}

.level-indicator {
    font-size: 0.7rem;
    color: var(--accent-color);
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.gamer-label {
    opacity: 0.6;
    font-size: 0.6rem;
}

.level-indicator #levelValue {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: #fff;
    text-shadow: 0 0 8px var(--accent-color);
}

.exp-bar-container {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    min-width: 50px;
}

.exp-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    box-shadow: 0 0 8px var(--accent-color);
    transition: width 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.exp-labels {
    font-size: 0.6rem;
    color: #fff;
    opacity: 0.6;
    letter-spacing: 1px;
    white-space: nowrap;
}

.exp-gain-float {
    position: fixed;
    pointer-events: none;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: var(--accent-color);
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.8);
    z-index: 10005;
    animation: expFloat 1.2s ease-out forwards;
}

@keyframes expFloat {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(-50px);
        opacity: 0;
    }
}

.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 0;
}

.hamburger-menu .bar {
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger-menu.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger-menu.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Responsive Navigation & Header Management */
@media (max-width: 1024px) {
    .header {
        padding: 15px 20px;
    }

    .exp-hud {
        max-width: 250px;
    }

    .gamer-label {
        display: none;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(5, 8, 15, 0.97);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        transition: right 0.6s cubic-bezier(0.19, 1, 0.22, 1);
        z-index: 999;
        /* Decorative grid overlay */
        background-image:
            linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px),
            linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px);
        background-size: 40px 40px;
        border-left: 1px solid rgba(0, 243, 255, 0.15);
    }

    /* Corner decorations */
    .nav-links::before,
    .nav-links::after {
        content: '';
        position: absolute;
        width: 40px;
        height: 40px;
        border-color: var(--accent-color);
        border-style: solid;
        opacity: 0.4;
    }

    .nav-links::before {
        top: 30px;
        left: 30px;
        border-width: 2px 0 0 2px;
    }

    .nav-links::after {
        bottom: 30px;
        right: 30px;
        border-width: 0 2px 2px 0;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        opacity: 0;
        transform: translateX(30px);
        list-style: none;
        width: 100%;
        text-align: center;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateX(0);
        transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    }

    /* Staggered animation for links */
    .nav-links.active li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-links.active li:nth-child(2) {
        transition-delay: 0.2s;
    }

    .nav-links.active li:nth-child(3) {
        transition-delay: 0.3s;
    }

    .nav-links.active li:nth-child(4) {
        transition-delay: 0.4s;
    }

    .nav-links.active li:nth-child(5) {
        transition-delay: 0.5s;
    }

    .nav-links a,
    .nav-links button {
        font-size: 1.4rem !important;
        letter-spacing: 5px;
        display: block;
        padding: 14px 40px;
        position: relative;
        transition: all 0.3s ease;
        color: var(--text-secondary) !important;
    }

    .nav-links a::before,
    .nav-links button::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 2px;
        background: var(--accent-color);
        transition: width 0.3s ease;
        box-shadow: 0 0 10px var(--accent-color);
    }

    .nav-links a:hover,
    .nav-links button:hover {
        color: var(--accent-color) !important;
        text-shadow: 0 0 20px var(--accent-color);
        padding-left: 55px;
    }

    .nav-links a:hover::before,
    .nav-links button:hover::before {
        width: 30px;
    }

    .hamburger-menu {
        display: flex;
    }
}

@media (max-width: 768px) {
    .exp-hud {
        margin: 0 10px;
        padding: 4px 10px;
        max-width: none;
        flex: 1;
        background: transparent;
        border: none;
        backdrop-filter: none;
    }

    .exp-bar-container {
        display: none;
    }
}

/* History Section */
.history-section {
    padding: 120px 20px;
    /* Background removed for seamless flow */
}

/* Game Log / History style */
.timeline {
    max-width: 900px;
    margin: 40px auto 0;
    position: relative;
    padding: 30px;
    background: rgba(0, 20, 30, 0.6);
    border: 1px solid var(--border-color);
    box-shadow: inset 0 0 20px rgba(0, 243, 255, 0.1);
    font-family: var(--font-main);
    clip-path: polygon(0 0,
            calc(100% - 20px) 0, 100% 20px,
            100% 100%,
            20px 100%, 0 calc(100% - 20px));
}

.timeline::before {
    content: "MISSION_LOG_DATA";
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--bg-color);
    padding: 0 15px;
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    color: var(--accent-color);
    border-left: 2px solid var(--accent-color);
    border-right: 2px solid var(--accent-color);
    z-index: 2;
}

.timeline-item {
    position: relative;
    padding: 20px;
    border-left: 2px solid rgba(0, 243, 255, 0.2);
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.4s ease;
    cursor: default;
}

.timeline-item:hover {
    background: rgba(0, 243, 255, 0.05);
    border-left-color: var(--accent-color);
    transform: translateX(10px);
}

.timeline-item::before {
    content: '> ';
    position: absolute;
    left: 10px;
    color: var(--accent-color);
    font-weight: bold;
    opacity: 0.5;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-date {
    display: inline-block;
    font-family: var(--font-pixel);
    font-size: 0.75rem;
    color: var(--accent-color);
    margin-bottom: 10px;
    background: rgba(0, 243, 255, 0.1);
    padding: 4px 8px;
    border-radius: 2px;
}

.timeline-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 15px;
}

.timeline-content h3::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), transparent);
}

.timeline-content p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.timeline-dot {
    display: none;
    /* Removed for log style */
}

/* Animations */
.fade-in,
.fade-in-up,
.fade-in-left,
.fade-in-right {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-up {
    transform: translateY(40px);
}

.fade-in-left {
    transform: translateX(-40px);
}

.fade-in-right {
    transform: translateX(40px);
}

.visible {
    opacity: 1 !important;
    transform: translate(0) !important;
}

.delay-200 {
    transition-delay: 0.2s;
}

/* Section Common - Moved up Header Styles */
section {
    padding: 120px 20px;
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.section-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent-color);
    margin-bottom: 12px;
    text-align: center;
}

.section-label.text-left {
    text-align: left;
}

.section-header {
    text-align: center;
    margin-bottom: 80px;
}

.section-header h2 {
    font-family: var(--font-pixel);
    font-size: 2.5rem;
    color: var(--accent-color);
    text-shadow: 2px 2px 0px #bc13fe;
    margin-bottom: 20px;
    letter-spacing: -1px;
    text-transform: uppercase;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* --- Game Mode Enhancements --- */

/* Focus Mode: Dim everything else */
body.game-mode-active .hero-content,
body.game-mode-active .hero,
body.game-mode-active .header,
body.game-mode-active .intro-section,
body.game-mode-active .featured-project,
body.game-mode-active .history-section,
body.game-mode-active .media-section,
body.game-mode-active .contact-section,
body.game-mode-active .footer-simple,
body.game-mode-active .scroll-indicator,
body.game-mode-active #scroll-line {
    opacity: 0.1;
    pointer-events: none;
    filter: blur(2px);
    transition: opacity 0.5s ease, filter 0.5s ease;
}

/* Hanafuda: behind content by default, in front during game mode */
.hanafuda-rain,
.hanafuda-card {
    z-index: 0;
}

body.game-mode-active .hanafuda-rain,
body.game-mode-active .hanafuda-card,
body.game-mode-active #game-hud {
    z-index: 99999 !important;
}


/* Yaku Display (Win Popup) - Relative to HUD now */
.yaku-message {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: rgba(0, 5, 10, 0.95);
    border: 2px solid var(--accent-color);
    padding: 20px 30px;
    border-radius: 12px;
    color: #fff;
    font-family: var(--font-pixel);
    font-size: 1.2rem;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.4), inset 0 0 20px rgba(0, 243, 255, 0.2);
    z-index: 100000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    min-width: 250px;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
    /* Space above HUD */
}

.yaku-message.show {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    pointer-events: auto;
}

.yaku-card-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

.yaku-card-img {
    width: 40px;
    /* Smaller for this context */
    height: 64px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}


.yaku-bonus-text {
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-top: 5px;
    display: block;
    text-shadow: 0 0 5px var(--accent-color);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    /* Background removed for seamless ambient effect */
}

.hero-content {
    z-index: 2;
    padding: 20px;
    max-width: 900px;
}

.hero-header-meta {
    margin-bottom: 20px;
    opacity: 0.8;
}

.hero-awards {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    animation: fadeIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both;
}

.award-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.award-pill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.award-pill.magnet-button:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-color);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

.award-pill.magnet-button:hover::before {
    left: 100%;
}

.award-pill .pill-title {
    font-size: 0.8rem;
    opacity: 0.7;
    letter-spacing: 0.05em;
    color: #ffd700;
}

.award-pill .pill-action {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    color: var(--accent-color);
    margin-top: 4px;
}

.badge-highlight {
    display: inline-block;
    padding: 6px 16px;
    background: var(--accent-gradient);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

.hero-title {
    font-size: min(6rem, 14vw);
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    text-transform: uppercase;
    color: #fff;
    position: relative;
    display: inline-block;
    transition: color 0.3s ease, text-shadow 0.3s ease;

    /* Elegant Shine Effect instead of Glitch */
    background: linear-gradient(120deg, transparent 0%, transparent 40%, rgba(0, 243, 255, 0.4) 50%, transparent 60%, transparent 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shine-title 8s linear infinite;
}

@keyframes shine-title {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.hero-subtitle {
    font-size: 1.8rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 50px;
    letter-spacing: -0.01em;
}

.hero-cta {
    margin-top: 30px;
    animation: fadeIn 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.6s both;
}

.cta-button {
    display: inline-block;
    padding: 20px 48px;
    border-radius: 100px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.cta-button.primary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.cta-button.primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 0 30px var(--accent-color);
    background: var(--accent-color);
    color: #000;
    position: relative;
    overflow: hidden;
}

.cta-button.primary:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: scan-shine 0.5s linear;
}

@keyframes scan-shine {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 3px;
    opacity: 0.5;
    animation: fadeIn 1s ease 1s both;
}

.scroll-indicator .line {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, var(--text-secondary), transparent);
}

.hero-background-elements .circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
}

.c1 {
    width: 600px;
    height: 600px;
    top: -200px;
    left: -100px;
    background: radial-gradient(circle, #007aff 0%, transparent 70%);
}

.c2 {
    width: 700px;
    height: 700px;
    bottom: -200px;
    right: -100px;
    background: radial-gradient(circle, #5e5ce6 0%, transparent 70%);
}

.c3 {
    width: 400px;
    height: 400px;
    top: 30%;
    left: 40%;
    background: radial-gradient(circle, rgba(0, 198, 255, 0.15) 0%, transparent 70%);
}

/* Project Showcase */
.project-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.app-icon-wrapper {
    margin-bottom: 30px;
}

.app-icon {
    width: 120px;
    height: 120px;
    border-radius: 26px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.project-details {
    margin-bottom: 30px;
}

.project-description {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.8;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
}

.tech-stack span {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.award-card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 149, 0, 0.05) 100%);
    border: 1px solid rgba(255, 215, 0, 0.2);
    padding: 24px;
    border-radius: 20px;
    margin-top: 30px;
    backdrop-filter: blur(var(--glass-blur));
    transition: transform 0.3s ease;
}

.award-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.award-header h4 {
    color: #ffd700;
    font-size: 1.2rem;
    font-weight: 700;
}

.award-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.device-container {
    position: relative;
    padding: 20px;
}

.iphone-frame {
    border: 12px solid #1c1c1e;
    border-radius: 54px;
    overflow: hidden;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.6);
    max-width: 340px;
    margin: 0 auto;
    background: #000;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.device-screen {
    width: 100%;
    height: auto;
    display: block;
}

.spatial-hint {
    position: absolute;
    bottom: -30px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    padding: 12px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 3;
}

.iris-icon {
    font-size: 1.2rem;
}

/* Intro Section */
.intro-section {
    padding: 160px 20px;
    /* Background removed for seamless flow */
}

.intro-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 80px;
    align-items: center;
}

.massive-text {
    font-size: min(5rem, 10vw);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 30px;
    background: linear-gradient(180deg, #fff 0%, #86868b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro-p {
    font-size: 1.4rem;
    color: var(--text-secondary);
    max-width: 500px;
    line-height: 1.6;
}

.identity-card {
    padding: 50px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.id-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-photo-wrapper {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    border-radius: 50%;
    padding: 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background-color: #1c1c1e;
    /* Placeholder background */
}

.id-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.id-bio {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.id-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.id-tags span {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
}

/* History Section - Overwritten above */

/* Game UI specific components */
.hud-card {
    background: rgba(10, 20, 30, 0.9);
    border: 1px solid var(--border-color);
    padding: 40px;
    position: relative;
    clip-path: polygon(20px 0, 100% 0,
            100% calc(100% - 20px), calc(100% - 20px) 100%,
            0 100%, 0 20px);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.hud-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    border-top: 2px solid var(--accent-color);
    border-left: 2px solid var(--accent-color);
}

.hud-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-bottom: 2px solid var(--accent-color);
    border-right: 2px solid var(--accent-color);
}

.glass-card {
    /* Legacy support or alias */
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: 4px;
    /* Reduced radius for tech look */
    backdrop-filter: blur(var(--glass-blur));
    position: relative;
}

.glass-card h3 {
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.focus-list {
    list-style: none;
}

.focus-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.focus-list li:last-child {
    border-bottom: none;
}

.level {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-color);
    background: rgba(0, 122, 255, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
}

/* ezuQ Specific Styles */
.ezuq-section {
    background: linear-gradient(to top, transparent, rgba(0, 122, 255, 0.05), transparent);
}

.project-showcase.reversed {
    grid-template-columns: 0.8fr 1fr;
}

.project-showcase.reversed .project-media {
    order: -1;
}

.download-badge-inline {
    display: inline-flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    border-radius: 20px;
    backdrop-filter: blur(var(--glass-blur));
    margin-top: 10px;
}

.download-badge-inline .count {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.download-badge-inline .label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.screenshot-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.screenshot-placeholder span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    opacity: 0.6;
}

.device-screen+.screenshot-placeholder {
    display: none;
}

.device-screen[src=""],
.device-screen:not([src]) {
    display: none;
}

.device-screen[src=""]:next-sibling .screenshot-placeholder,
.device-screen:not([src])+.screenshot-placeholder {
    display: flex;
}


/* Utils */
.cursor-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 122, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

/* Contact Section */
.contact-section {
    padding: 100px 20px 160px;
    /* Background removed for seamless flow */
}

.contact-card-wrapper {
    perspective: 1000px;
    max-width: 800px;
    margin: 0 auto;
}

.contact-card {
    background: rgba(28, 28, 30, 0.6);
    padding: 60px;
    border-radius: 40px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    transition: transform 0.1s ease-out;
}

.contact-card h2 {
    font-size: 3rem;
    background: var(--text-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

.contact-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 40px;
}

.contact-actions {
    margin-bottom: 50px;
}

.social-links-large {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.social-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.3s ease;
    padding: 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
}

.social-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

.social-icon {
    font-size: 2rem;
}

.social-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Footer Simple */
.footer-simple {
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.8rem;
    opacity: 0.6;
}

/* ezuQ Specific Styles */
.ezuq-section {
    background: linear-gradient(to top, transparent, rgba(0, 122, 255, 0.05), transparent);
}

.project-showcase.reversed {
    grid-template-columns: 0.8fr 1fr;
}

.project-showcase.reversed .project-media {
    order: -1;
}

.download-badge-inline {
    display: inline-flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    border-radius: 20px;
    backdrop-filter: blur(var(--glass-blur));
    margin-top: 10px;
}

.download-badge-inline .count {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.download-badge-inline .label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.screenshot-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.screenshot-placeholder span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    opacity: 0.6;
}

.device-screen+.screenshot-placeholder {
    display: none;
}

.device-screen[src=""],
.device-screen:not([src]) {
    display: none;
}

.device-screen[src=""]:next-sibling .screenshot-placeholder,
.device-screen:not([src])+.screenshot-placeholder {
    display: flex;
}


/* Utils */
.dud {
    color: var(--accent-color);
    opacity: 0.7;
}

.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(0, 122, 255, 0.05) 40%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    transform: translate(-50%, -50%);
    /* Initial state */
    will-change: transform;
    /* Performance optimization */
    mix-blend-mode: screen;
    filter: blur(30px);
}

/* Responsive */
@media (max-width: 768px) {

    .project-showcase,
    .intro-grid {
        grid-template-columns: 1fr;
        gap: 60px;
        /* Increased gap */
        text-align: center;
    }

    /* Reset order for reversed layout on mobile to keep text first, image second */
    .project-showcase.reversed {
        display: flex;
        flex-direction: column;
    }

    .project-showcase.reversed .project-info {
        order: 1;
    }

    .project-showcase.reversed .project-media {
        order: 2;
        margin-top: 20px;
    }

    /* Fix for iPhone frame visibility */
    .iphone-frame {
        max-width: 280px;
        /* Slightly smaller on mobile */
        width: 100%;
        margin-bottom: 30px;
        min-height: 500px;
        /* Force height if image fails */
        aspect-ratio: 9 / 19.5;
        /* Ensure proper shape */
        margin-left: auto;
        margin-right: auto;
    }

    .intro-p {
        margin: 0 auto;
        padding: 0 20px;
        /* Add padding to prevent text touching edges */
    }

    .massive-text {
        font-size: 12vw;
        /* Use vw to scale with screen width properly */
        line-height: 1.1;
    }

    .hero-title {
        font-size: 13vw;
        /* Use vw to scale inside screen */
    }

    .contact-card {
        padding: 40px 20px;
    }

    .contact-card h2 {
        font-size: 2rem;
    }

    .section-label.text-left {
        text-align: center;
    }

    .wwdc-badge {
        height: 80px;
    }

    .tech-stack {
        justify-content: center;
    }

    .header {
        padding: 5px 20px;
    }

    .identity-card {
        padding: 30px;
        align-items: center;
        /* Center flex items */
        text-align: center;
        /* Center text */
    }

    .profile-photo-wrapper {
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 20px;
    }

    .id-tags {
        justify-content: center;
    }
}

/* Global mobile overflow fix */
@media (max-width: 480px) {

    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }
}

/* Contact Form Styles */
.contact-form {
    width: 100%;
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
    width: 100%;
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-main);
    transition: all 0.3s ease;
    outline: none;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

textarea.form-input {
    min-height: 120px;
    resize: vertical;
}

.form-submit {
    align-self: flex-start;
    border: none;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Success/Error States */
.form-input.success {
    border-color: #34c759;
}

.form-input.error {
    border-color: #ff3b30;
}

.form-message {
    margin-top: 15px;
    padding: 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
    animation: fadeIn 0.5s ease;
}

.form-message.success {
    background: rgba(52, 199, 89, 0.1);
    border: 1px solid rgba(52, 199, 89, 0.2);
    color: #34c759;
    display: block;
}

.form-message.error {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.2);
    color: #ff3b30;
    display: block;
}

/* Social Links Spacing */
.social-links-large {
    margin-top: 80px;
    /* Increased spacing */
    display: flex;
    justify-content: center;
    gap: 30px;
}

.social-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    padding: 15px;
    border-radius: 12px;
}

.social-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.social-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}


/* App Store Badge */
/* App Store Badge */
.store-badge-container {
    margin-top: 24px;
}

.app-store-badge {
    height: 40px;
    width: auto;
    transition: transform 0.3s ease;
}

.app-header-row {
    display: flex;
    align-items: flex-end;
    /* Changed from center to flex-end */
    gap: 20px;
    margin-bottom: 30px;
}

/* Override existing margins inside header row */
.app-header-row .app-icon-wrapper {
    margin-bottom: 0;
}

.app-header-row .store-badge-container {
    margin-top: 0;
}

.store-link:hover .app-store-badge {
    transform: scale(1.05);
}

/* Coming Soon Badge */
.coming-soon-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.media-badge {
    display: inline-block;
    font-family: var(--font-pixel);
    font-size: 0.65rem;
    color: var(--accent-color);
    background: rgba(0, 243, 255, 0.1);
    padding: 4px 10px;
    border-radius: 2px;
    margin-bottom: 20px;
}

.media-card h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    line-height: 1.4;
}

.media-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.6;
}


/* media.html entry styles (if different) */
.media-entry {
    position: relative;
    overflow: hidden;
}

.media-entry-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.1;
    filter: saturate(0) blur(3px);
    z-index: 0;
    transition: opacity 0.4s ease;
}

.media-entry:hover .media-entry-bg {
    opacity: 0.2;
    filter: saturate(0.5) blur(1px);
}

.entry-main,
.entry-link,
.entry-date {
    position: relative;
    z-index: 1;
}

/* Explosion Particle */
.particle {
    position: fixed;
    pointer-events: none;
    background: var(--accent-color);
    border-radius: 50%;
    z-index: 10001;
    /* Above cursor and scanlines */
}

/* Effect Shapes */
.particle.square {
    border-radius: 0;
}

.particle.glow-soft {
    box-shadow: 0 0 8px currentColor;
}

.particle.glow-strong {
    box-shadow: 0 0 15px currentColor;
}

/* Media Archive Section */
.media-section {
    padding: 100px 20px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.media-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.media-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    filter: saturate(0.5) blur(2px);
    z-index: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.media-card:hover .media-card-bg {
    opacity: 0.25;
    transform: scale(1.1);
}

.media-card .hud-card-content {
    position: relative;
    z-index: 1;
}

.media-badge {
    position: relative;
    z-index: 1;
    display: inline-block;
    font-family: var(--font-pixel);
    font-size: 0.65rem;
    color: var(--accent-color);
    background: rgba(0, 243, 255, 0.1);
    padding: 4px 10px;
    border-radius: 2px;
    margin-bottom: 20px;
}

.media-card h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    line-height: 1.4;
}

.media-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.6;
}

.media-link {
    position: relative;
    z-index: 1;
    display: inline-block;
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.media-link:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--accent-color);
}

/* Hanafuda Rain Effect */
.hanafuda-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    /* Behind regular content by default */
    overflow: hidden;
    perspective: 800px;
}

.game-mode-active .hanafuda-rain {
    pointer-events: auto;
}

.hanafuda-card {
    position: absolute;
    width: 60px;
    height: 96px;
    opacity: 0;
    will-change: transform, opacity;
    /* Remove transform-style from shell to keep hitbox flat and stable */
    background-color: transparent;
    border-radius: 4px;
    pointer-events: none;
    /* Default */
}

.hanafuda-visuals {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    background-color: #1a0f0f;
    /* Edge color moved here */
    border-radius: 4px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    transition: filter 0.3s ease;
}

.hanafuda-front,
.hanafuda-back,
.hanafuda-side {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.hanafuda-front,
.hanafuda-back {
    background-size: cover;
    background-position: center;
    border-radius: 2px;
}

.hanafuda-side {
    background-color: #000;
    /* Side color is black as requested */
}

/* Front face: 4px forward */
.hanafuda-front {
    transform: translateZ(4px);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Back face: 4px backward and rotated */
.hanafuda-back {
    transform: rotateY(180deg) translateZ(4px);
}

/* Sides to connect front and back (8px total thickness) */
.side-t {
    height: 8px;
    top: 0;
    margin-top: -4px;
    transform: rotateX(90deg);
}

.side-b {
    height: 8px;
    top: 100%;
    margin-top: -4px;
    transform: rotateX(90deg);
}

.side-l {
    width: 8px;
    left: 0;
    margin-left: -4px;
    transform: rotateY(90deg);
}

.side-r {
    width: 8px;
    left: 100%;
    margin-left: -4px;
    transform: rotateY(90deg);
}

/* Hanafuda Game HUD Styles */
.award-pill.magnet-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.award-pill.magnet-button:hover {
    background: rgba(var(--accent-rgb), 0.2);
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.3);
}

.award-pill.magnet-button {
    z-index: 1001;
    /* Above hanafuda-rain (999) */
}

.award-pill.magnet-button.active {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 30px var(--accent-color);
    z-index: 1100;
}

/* Ensure toggle button is clickable while cards are underneath */
.game-mode-active .hero,
.game-mode-active .hero-content {
    pointer-events: none;
    z-index: 1000;
}

.game-mode-active #gameModeToggle {
    pointer-events: auto;
}

.game-hud {
    position: fixed;
    bottom: -200px;
    /* Hide deeper to ensure no shadows show */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    background: rgba(10, 5, 5, 0.95);
    /* Darker, more solid background */
    backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid var(--accent-color);
    /* Thicker, defined border */
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    padding: 1.5rem 2rem;
    z-index: 2000;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto !important;
    overflow: visible !important;
    box-shadow: 0 -10px 40px rgba(var(--accent-rgb), 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.game-mode-active .game-hud {
    bottom: 0;
    box-shadow: 0 -15px 50px rgba(var(--accent-rgb), 0.5),
        0 0 0 1px rgba(var(--accent-rgb), 0.8);
}

.hand-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.hud-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--accent-color);
    opacity: 0.7;
}

.hud-hint {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.6rem;
    color: #fff;
    opacity: 0.5;
    letter-spacing: 1px;
    margin-top: 5px;
}

.hanafuda-hand {
    display: flex;
    gap: 10px;
    min-height: 80px;
    padding: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.hand-card {
    width: 40px;
    height: 64px;
    background-size: cover;
    background-position: center;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
    position: relative;
}

.hand-card[data-rarity="gold"] {
    background-color: #ffd700;
    background-blend-mode: multiply;
    filter: grayscale(1) contrast(1.5) brightness(0.9);
    border-color: gold;
    box-shadow: 0 0 15px gold, 0 0 30px rgba(255, 215, 0, 0.3);
    overflow: hidden;
}

.hand-card[data-rarity="gold"]::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0) 40%,
            rgba(255, 255, 255, 0.5) 50%,
            rgba(255, 255, 255, 0) 60%,
            transparent 100%);
    transform: rotate(25deg);
    animation: goldMetalShine 3s ease-in-out infinite;
    pointer-events: none;
    mix-blend-mode: overlay;
    z-index: 5;
}

.hand-card[data-rarity="rainbow"] {
    background-color: transparent;
    border-color: #ff0000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
    /* Important: preserve background-image set by JS */
}

.hand-card[data-rarity="rainbow"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff0000, #ff7700, #ffff00, #00ff00, #0000ff, #8b00ff, #ff0000);
    background-size: 200% 200%;
    animation: rainbowGlow 2s linear infinite;
    z-index: -1;
}

/* Multiplier for the card image to blend with the rainbow background behind it */
.hand-card[data-rarity="rainbow"] {
    background-blend-mode: multiply;
    /* Note: hand-card sets background-image via JS. 
       Adding a fallback background-color to ensure multiply works if image is present */
    background-color: #fff;
    filter: grayscale(0.5) contrast(1.2) brightness(1.1);
}

.hand-card[data-rarity="rainbow"]::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0) 40%,
            rgba(255, 255, 255, 0.7) 50%,
            rgba(255, 255, 255, 0) 60%,
            transparent 100%);
    transform: rotate(25deg);
    animation: goldMetalShine 2s ease-in-out infinite;
    pointer-events: none;
    mix-blend-mode: overlay;
    z-index: 5;
}

.hand-card:hover {
    transform: translateY(-10px) scale(1.1);
    z-index: 10;
}


/* Mobile Optimizations for Game HUD */
@media (max-width: 768px) {
    .game-hud {
        width: 95%;
        padding: 1rem;
        bottom: -250px;
    }

    .game-mode-active .game-hud {
        bottom: env(safe-area-inset-bottom, 0);
    }

    .hanafuda-hand {
        gap: 5px;
        min-height: 60px;
    }

    .hand-card {
        width: 30px;
        height: 48px;
    }

    .game-close-btn {
        top: 10px;
        right: 10px;
        padding: 8px 15px;
        font-size: 0.8rem;
    }

    .yaku-message {
        font-size: 0.9rem;
    }
}

/* Increase hit area for hanafuda cards in game mode */
.game-mode-active .hanafuda-card::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    z-index: -1;
}

.game-mode-active .hanafuda-card {
    pointer-events: auto !important;
    cursor: copy;
    touch-action: manipulation;
}

.game-mode-active .hanafuda-card:hover {
    filter: brightness(1.5) drop-shadow(0 0 10px var(--accent-color));
}

.game-close-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.5);
    color: #ff4444;
    padding: 10px 20px;
    border-radius: 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2001;
}

.game-close-btn:hover {
    background: #ff4444;
    color: #000;
}

/* Back to Home Button */
.back-to-home-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 60px;
    height: 60px;
    background: rgba(10, 20, 30, 0.8);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

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

.back-to-home-btn:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.5);
    transform: scale(1.1);
}

.back-to-home-btn .icon {
    font-size: 1.2rem;
    line-height: 1;
}

.back-to-home-btn .label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .back-to-home-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}

/* LV. 5 Ability: Cherry Blossom Petals */
.particle.petal {
    border-radius: 50% 0 50% 50%;
    transform: rotate(45deg);
}

/* LV. 15 Ability: Golden HUD Theme */
.theme-gold {
    --accent-color: #ffd700;
    --accent-glow: rgba(255, 215, 0, 0.4);
}

.theme-gold .logo,
.theme-gold .nav-links a:hover,
.theme-gold .gamer-label,
.theme-gold #levelValue,
.theme-gold .exp-bar,
.theme-gold .back-to-home-btn,
.theme-gold .cta-button.primary {
    color: #ffd700 !important;
    border-color: #ffd700 !important;
}

.theme-gold .exp-bar {
    background: #ffd700 !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.theme-gold .back-to-home-btn:hover {
    background: #ffd700 !important;
    color: #000 !important;
}

.theme-gold .hud-card {
    border-color: rgba(255, 215, 0, 0.3) !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.1) !important;
}

.theme-gold .hud-card::before,
.theme-gold .hud-card::after {
    border-color: #ffd700 !important;
}

/* --- Profile Overlay Styles --- */
.profile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    z-index: 2000;
    display: none;
    /* Controlled by JS */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.profile-overlay.active {
    display: flex;
    opacity: 1;
}

.profile-card {
    width: 90%;
    max-width: 500px;
    background: rgba(10, 20, 30, 0.95);
    padding: 30px;
    border: 1px solid var(--accent-color);
    position: relative;
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.2);
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.profile-close-btn {
    background: transparent;
    border: none;
    color: var(--accent-color);
    font-family: var(--font-pixel);
    cursor: pointer;
    font-size: 1rem;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

.profile-close-btn:hover {
    background: var(--accent-color);
    color: #000;
}

.profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.progress-item {
    grid-column: span 2;
}

.stat-label {
    font-size: 0.6rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    color: var(--accent-color);
    font-weight: 700;
}

.mini-exp-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 5px;
}

.mini-exp-fill {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px var(--accent-color);
}

.customization-section {
    margin-bottom: 25px;
}

.section-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-left: 0;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-transform: uppercase;
    font-family: 'Orbitron', sans-serif;
}

.option-btn:hover:not(.locked) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
    color: var(--text-primary);
}

.option-btn.active {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
    font-weight: 700;
}

.option-btn.locked {
    opacity: 0.4;
    cursor: not-allowed;
    border-style: dashed;
}

.option-btn.locked::after {
    content: ' [LOCKED]';
    display: block;
    font-size: 0.5rem;
    margin-top: 4px;
}

.profile-footer {
    text-align: center;
    margin-top: 20px;
    opacity: 0.5;
}

/* --- Theme Color Variants --- */
body.theme-forest {
    --accent-color: #4ade80;
}

body.theme-sunset {
    --accent-color: #fb923c;
}

body.theme-midnight {
    --accent-color: #5d8cff;
}

body.theme-gold {
    --accent-color: #fbbf24;
}

body.theme-obsidian {
    --accent-color: #94a3b8;
}

body.theme-obsidian {
    background-color: #020617;
}

/* Specific adjustments for themes */
[class*="theme-"] .exp-bar,
[class*="theme-"] .mini-exp-fill,
[class*="theme-"] .back-to-home-btn {
    box-shadow: 0 0 15px var(--accent-color);
}

/* --- Player Name Input Styles --- */
.player-name-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--accent-color);
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 8px 12px;
    width: 100%;
    outline: none;
    transition: all 0.3s ease;
    margin-top: 5px;
    box-sizing: border-box;
    text-transform: uppercase;
}

.player-name-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-color);
}

/* --- Achievement Toast --- */
.achievement-toasts {
    position: fixed;
    bottom: 110px;
    right: 20px;
    z-index: 100001;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
}

.achievement-toast-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(5, 10, 18, 0.97);
    border: 1px solid var(--accent-color);
    border-left: 3px solid var(--accent-color);
    padding: 12px 16px;
    min-width: 260px;
    max-width: 320px;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.15), 0 8px 24px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.4s ease;
    pointer-events: auto;
}

.achievement-toast-item.show {
    transform: translateX(0);
    opacity: 1;
}

.ach-toast-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.ach-toast-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.ach-toast-label {
    font-family: var(--font-pixel);
    font-size: 0.45rem;
    color: var(--accent-color);
    letter-spacing: 0.1em;
    opacity: 0.8;
}

.ach-toast-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ach-toast-exp {
    font-family: var(--font-pixel);
    font-size: 0.5rem;
    color: #ffd700;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .achievement-toasts {
        bottom: 160px;
        right: 10px;
        left: 10px;
    }

    .achievement-toast-item {
        min-width: unset;
        max-width: 100%;
    }
}

/* --- Achievement List (Profile Overlay) --- */
.profile-card {
    overflow-y: auto;
    max-height: 92vh;
}

.achievements-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
    margin-top: 5px;
}

.ach-count {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    color: var(--accent-color);
    margin-left: 8px;
    font-weight: 400;
}

.achievement-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
    margin-top: 10px;
}

.achievement-list::-webkit-scrollbar {
    width: 3px;
}

.achievement-list::-webkit-scrollbar-track {
    background: transparent;
}

.achievement-list::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 2px;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.2s;
}

.achievement-item.unlocked {
    border-color: rgba(0, 243, 255, 0.2);
    background: rgba(0, 243, 255, 0.04);
}

.achievement-item.locked {
    opacity: 0.45;
}

.ach-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.ach-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
    min-width: 0;
}

.ach-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.05em;
}

.ach-desc {
    font-size: 0.55rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ach-exp {
    font-family: var(--font-pixel);
    font-size: 0.48rem;
    color: #ffd700;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 2px 5px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* --- LV100 System: New Themes --- */
body.theme-cherry {
    --accent-color: #f472b6;
}

body.theme-ocean {
    --accent-color: #22d3ee;
}

body.theme-crimson {
    --accent-color: #ef4444;
}

body.theme-violet {
    --accent-color: #a78bfa;
}

body.theme-emerald {
    --accent-color: #10b981;
}

body.theme-rose {
    --accent-color: #f43f5e;
}

body.theme-hologram {
    --accent-color: #ff2d78;
}

body.theme-platinum {
    --accent-color: #e2e8f0;
}

body.theme-sakura {
    --accent-color: #fda4af;
}

/* Title Display */
.title-value {
    color: var(--accent-color);
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
}

/* --- Profile Frame Animations --- */
@keyframes framePulse {

    0%,
    100% {
        box-shadow: 0 0 8px var(--accent-color), inset 0 0 8px rgba(0, 243, 255, 0.1);
    }

    50% {
        box-shadow: 0 0 20px var(--accent-color), inset 0 0 15px rgba(0, 243, 255, 0.2);
    }
}

@keyframes frameSweep {
    0% {
        background-position: -300% center;
    }

    100% {
        background-position: 300% center;
    }
}

@keyframes frameRainbow {
    0% {
        border-color: #ff0000;
        box-shadow: 0 0 15px #ff0000;
    }

    16% {
        border-color: #ff7700;
        box-shadow: 0 0 15px #ff7700;
    }

    33% {
        border-color: #ffff00;
        box-shadow: 0 0 15px #ffff00;
    }

    50% {
        border-color: #00ff00;
        box-shadow: 0 0 15px #00ff00;
    }

    66% {
        border-color: #0000ff;
        box-shadow: 0 0 15px #0000ff;
    }

    83% {
        border-color: #8b00ff;
        box-shadow: 0 0 15px #8b00ff;
    }

    100% {
        border-color: #ff0000;
        box-shadow: 0 0 15px #ff0000;
    }
}

.profile-card.frame-glow {
    animation: framePulse 2s ease-in-out infinite;
}

.profile-card.frame-sweep {
    background-image: linear-gradient(90deg, transparent 30%, rgba(0, 243, 255, 0.15) 50%, transparent 70%);
    background-size: 300% 100%;
    animation: frameSweep 3s linear infinite;
}

.profile-card.frame-double {
    box-shadow: 0 0 0 3px var(--accent-color), 0 0 0 6px rgba(0, 243, 255, 0.3), 0 0 50px rgba(0, 243, 255, 0.2);
}

.profile-card.frame-diamond {
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4), 0 0 0 6px rgba(0, 243, 255, 0.1);
    outline: 2px solid rgba(0, 243, 255, 0.4);
    outline-offset: 4px;
}

.profile-card.frame-legend {
    animation: frameRainbow 2s linear infinite;
    border-width: 2px;
}

/* --- EXP Bar Skins --- */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

@keyframes expPulse {

    0%,
    100% {
        box-shadow: 0 0 5px var(--accent-color);
    }

    50% {
        box-shadow: 0 0 15px var(--accent-color), 0 0 25px var(--accent-color);
    }
}

@keyframes expFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.exp-bar.skin-shimmer {
    background: linear-gradient(90deg, var(--accent-color) 0%, #ffffff 50%, var(--accent-color) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

.exp-bar.skin-pulse {
    animation: expPulse 1.5s ease-in-out infinite;
}

.exp-bar.skin-flow {
    background: linear-gradient(90deg, #00f3ff, #bc13fe, #ff6b6b, #00f3ff);
    background-size: 300% 100%;
    animation: expFlow 3s ease infinite;
}

.exp-bar.skin-plasma {
    background: linear-gradient(90deg, #7c3aed, #06b6d4, #7c3aed);
    background-size: 300% 100%;
    animation: expFlow 2s ease infinite;
}

.exp-bar.skin-cosmic {
    background: linear-gradient(90deg, #1e1b4b, #4f46e5, #7c3aed, #c026d3, #4f46e5, #1e1b4b);
    background-size: 300% 100%;
    animation: expFlow 4s ease infinite;
    box-shadow: 0 0 15px #4f46e5, 0 0 25px rgba(124, 58, 237, 0.5);
}

/* --- Cursor Level Upgrades --- */
body.cursor-lv20 .custom-cursor {
    width: 24px;
    height: 24px;
    box-shadow: 0 0 12px var(--accent-color);
}

@keyframes cursorRing {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.2;
    }
}

body.cursor-lv40 .custom-cursor::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    animation: cursorRing 1s ease-in-out infinite;
    opacity: 0.5;
    pointer-events: none;
}

body.cursor-lv60 .custom-cursor {
    outline: 2px solid rgba(0, 243, 255, 0.3);
    outline-offset: 5px;
}

@keyframes cursorSparkle {

    0%,
    100% {
        box-shadow: 0 0 20px var(--accent-color), 0 0 40px rgba(0, 243, 255, 0.3);
    }

    50% {
        box-shadow: 0 0 30px var(--accent-color), 0 0 60px rgba(0, 243, 255, 0.5);
    }
}

body.cursor-lv80 .custom-cursor {
    width: 28px;
    height: 28px;
    box-shadow: 0 0 20px var(--accent-color), 0 0 40px rgba(0, 243, 255, 0.3);
    animation: cursorSparkle 2s ease-in-out infinite;
}

/* --- Gold / Rainbow Card CSS --- */
@keyframes goldMetalShine {
    0% {
        transform: translateZ(5px) translateX(-100%) rotate(25deg);
    }

    /* Wait for a few seconds before restarting the shine */
    40%,
    100% {
        transform: translateZ(5px) translateX(200%) rotate(25deg);
    }
}

.hanafuda-visuals[data-rarity="gold"] {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6), 0 0 20px gold, 0 0 40px rgba(255, 215, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.8);
    background: linear-gradient(135deg,
            #ffd700 0%,
            #fff8bc 20%,
            #e1b000 40%,
            #ffec68 60%,
            #b28a00 80%,
            #ffd700 100%) !important;
    overflow: visible;
}

.hanafuda-visuals[data-rarity="gold"] .hanafuda-front {
    mix-blend-mode: multiply;
    filter: grayscale(1) contrast(1.8) brightness(0.9);
    overflow: hidden;
    /* Enable clipping for Specular Shine */
}

/* Shine effect - now a child of .hanafuda-front for clipping */
.hanafuda-visuals[data-rarity="gold"] .hanafuda-front::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0) 40%,
            rgba(255, 255, 255, 0.6) 50%,
            rgba(255, 255, 255, 0) 60%,
            transparent 100%);
    transform: rotate(25deg);
    animation: goldMetalShine 4s ease-in-out infinite;
    pointer-events: none;
    mix-blend-mode: screen;
    z-index: 10;
}

/* Ensure the back is solid to hide the gold base */
.hanafuda-visuals[data-rarity="gold"] .hanafuda-back {
    background-color: #1a0f0f;
    mix-blend-mode: normal;
    transform: rotateY(180deg) translateZ(4px);
    background-size: cover;
}

/* Ensure the back is normal for metallic cards */
.hanafuda-visuals[data-rarity="gold"] .hanafuda-back,
.hanafuda-visuals[data-rarity="rainbow"] .hanafuda-back {
    mix-blend-mode: normal;
    filter: none;
    background-color: #000;
}

@keyframes rainbowGlow {
    0% {
        box-shadow: 0 0 15px #ff0000;
        border-color: #ff0000;
    }

    16% {
        box-shadow: 0 0 15px #ff7700;
        border-color: #ff7700;
    }

    33% {
        box-shadow: 0 0 15px #ffff00;
        border-color: #ffff00;
    }

    50% {
        box-shadow: 0 0 15px #00ff00;
        border-color: #00ff00;
    }

    66% {
        box-shadow: 0 0 15px #0000ff;
        border-color: #0000ff;
    }

    83% {
        box-shadow: 0 0 15px #8b00ff;
        border-color: #8b00ff;
    }

    100% {
        box-shadow: 0 0 15px #ff0000;
        border-color: #ff0000;
    }
}

.hanafuda-visuals[data-rarity="rainbow"] {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6), 0 0 10px rgba(255, 0, 0, 0.2);
    border: 1px solid #ff0000;
    background: linear-gradient(135deg,
            #ff0000, #ff7700, #ffff00, #00ff00, #0000ff, #8b00ff, #ff0000) !important;
    background-size: 200% 200% !important;
    animation: rainbowGlow 2s linear infinite;
    overflow: visible;
}

.hanafuda-visuals[data-rarity="rainbow"] .hanafuda-front {
    mix-blend-mode: multiply;
    filter: grayscale(1) contrast(2.2) brightness(0.85);
    overflow: hidden;
    /* Enable clipping for Specular Shine */
}

/* Shine effect - now a child of .hanafuda-front for clipping */
.hanafuda-visuals[data-rarity="rainbow"] .hanafuda-front::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0) 40%,
            rgba(255, 255, 255, 0.8) 50%,
            rgba(255, 255, 255, 0) 60%,
            transparent 100%);
    transform: rotate(25deg);
    animation: goldMetalShine 2s ease-in-out infinite;
    pointer-events: none;
    mix-blend-mode: screen;
    z-index: 10;
}

.hanafuda-visuals[data-rarity="rainbow"] .hanafuda-back {
    background-color: #1a0f0f;
    mix-blend-mode: normal;
}

/* Ensure the back is normal for metallic cards */
.hanafuda-visuals[data-rarity="rainbow"] .hanafuda-back {
    mix-blend-mode: normal;
    filter: none;
    background-color: #000;
}

/* --- Extra Particle Shapes --- */
.particle.diamond-shape {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    border-radius: 0;
}

.particle.line-shape {
    width: 2px !important;
    height: 20px !important;
    border-radius: 1px;
}