/* ===== CHRONOSPHERE DESIGN SYSTEM INTEGRATION ===== */

/* Import Chronosphere fonts */
@import url(https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap);

/* Chronosphere CSS Variables */
:root {
    --chronosphere-secondary: #182eba;
    --chronosphere-primary: #28a561;
    --chronosphere-white: #fff;
    --chronosphere-primary-hover: #86e38e;
    --chronosphere-dark-gray: #4a5056;
    --chronosphere-gray: #959595;
    --chronosphere-dark-blue: #182eba;
    --chronosphere-light-gray: #f7f7f7;
    --chronosphere-light-green: #ddf7e2;
    --chronosphere-purple: #6320ee;
    --chronosphere-yellow: #ffdd2c;
    --chronosphere-status-error: #e4260a;
    --chronosphere-black: #131314;
}

/* ===== BASE STYLES - CHRONOSPHERE TYPOGRAPHY ===== */
html, body {
    font-size: 16px;
    line-height: 1.4em;
    letter-spacing: 0.16px;
    font-family: "Poppins", sans-serif;
    font-weight: 400;
    background-color: var(--chronosphere-white);
    color: var(--chronosphere-dark-gray);
    /* Ensure scrolling works properly on mobile */
    overflow-x: hidden;
    overflow-y: auto;
}

p, .p {
    font-size: 16px;
    line-height: 1.4em;
    letter-spacing: 0.16px;
    font-family: "Poppins", sans-serif;
    font-weight: 400;
    color: var(--chronosphere-dark-gray);
}

h1, .h1 {
    font-size: 2.3rem;
    line-height: 1.1em;
    letter-spacing: -2.4px;
    font-family: "DM Sans", sans-serif;
    font-weight: 600;
    color: var(--chronosphere-black);
}

h2, .h2 {
    font-size: 1.9rem;
    line-height: 1.2em;
    letter-spacing: -1.47px;
    font-family: "DM Sans", sans-serif;
    font-weight: 600;
    color: var(--chronosphere-black);
}

h3, .h3 {
    font-size: 1.6rem;
    line-height: 1.3em;
    letter-spacing: -0.78px;
    font-family: "DM Sans", sans-serif;
    font-weight: 600;
    color: var(--chronosphere-black);
}

h4, .h4 {
    font-size: 1.4rem;
    line-height: 1.3em;
    letter-spacing: -0.62px;
    font-family: "DM Sans", sans-serif;
    font-weight: 600;
    color: var(--chronosphere-black);
}

h5, .h5 {
    font-size: 1.3rem;
    line-height: 1.2em;
    letter-spacing: -0.5px;
    font-family: "DM Sans", sans-serif;
    font-weight: 500;
    color: var(--chronosphere-black);
}

h6, .h6 {
    font-size: 0.9rem;
    line-height: 1.3em;
    letter-spacing: 0.2px;
    font-family: "DM Sans", sans-serif;
    font-weight: 500;
    color: var(--chronosphere-black);
}

/* ===== LINKS ===== */
a {
    color: var(--chronosphere-primary);
    transition: color 0.2s ease-in-out;
    text-decoration: none;
}

a:hover {
    color: var(--chronosphere-primary-hover);
    text-decoration: none;
}

a:focus {
    color: var(--chronosphere-primary-hover);
}

/* ===== NAVIGATION STYLING ===== */
.navbar-brand {
    font-weight: bold;
    letter-spacing: 1px;
    font-family: "DM Sans", sans-serif;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s;
    font-family: "Poppins", sans-serif;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 1);
}

/* ===== CHRONOSPHERE BUTTON STYLES ===== */
.btn, 
.fl-button,
.wp-block-button__link,
button {
    border-radius: 5px;
    border: 1px solid var(--chronosphere-primary);
    background-color: var(--chronosphere-primary);
    padding: 12px 24px;
    color: var(--chronosphere-white);
    font-size: 16px;
    font-family: "DM Sans", sans-serif;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.16px;
    transition: background-color 0.2s ease-in-out;
    text-decoration: none;
    cursor: pointer;
    position: relative;
}

.btn:hover,
.fl-button:hover,
.wp-block-button__link:hover,
button:hover {
    border-color: var(--chronosphere-secondary);
    background-color: var(--chronosphere-secondary);
    color: var(--chronosphere-white);
    text-decoration: none;
}

.btn-secondary {
    border-color: var(--chronosphere-secondary);
    background-color: var(--chronosphere-white);
    color: var(--chronosphere-secondary);
}

.btn-secondary:hover {
    background-color: var(--chronosphere-secondary);
    color: var(--chronosphere-white);
}

/* ===== CARD STYLING ===== */
.card {
    border-radius: 10px;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.08), 0 0 4px 0 rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    margin-bottom: 20px;
    border: none;
    background-color: var(--chronosphere-white);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: linear-gradient(135deg, var(--chronosphere-light-gray) 0%, #e9ecef 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 10px 10px 0 0 !important;
    padding: 1rem 1.5rem;
    font-family: "DM Sans", sans-serif;
    font-weight: 600;
    color: var(--chronosphere-black);
}

/* ===== GAME CONTAINER ===== */
#game-container {
    background-color: var(--chronosphere-light-gray);
    border-radius: 10px;
    overflow: visible;
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.08), 0 0 4px 0 rgba(0, 0, 0, 0.04);
    /* Ensure touch events work normally when not in fullscreen */
    touch-action: auto;
}

/* Ensure Phaser DOM elements render above the canvas */
#game-container > div {
    position: absolute !important;
    z-index: 1000 !important;
    width: 100%;
}

/* Fullscreen mode styles */
#game-container:fullscreen {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
}

#game-container:-webkit-full-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
}

#game-container:-moz-full-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
}

#game-container:-ms-fullscreen {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
}

/* Style the canvas in fullscreen mode */
#game-container:fullscreen canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain !important;
}

#game-container:-webkit-full-screen canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain !important;
}

#game-container:-moz-full-screen canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain !important;
}

#game-container:-ms-fullscreen canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain !important;
}

/* Fullscreen button styling */
.btn-fullscreen {
    background: none;
    border: none;
    color: var(--chronosphere-gray);
    padding: 0.25rem 0.5rem;
    transition: all 0.2s ease;
}

.btn-fullscreen:hover {
    color: var(--chronosphere-primary) !important;
    transform: scale(1.1);
}

/* Game Card Styling */
.game-card {
    border-radius: 12px;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.08), 0 0 4px 0 rgba(0, 0, 0, 0.04);
    border: none;
    overflow: hidden;
    width: 800px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.game-card .card-header {
    background: linear-gradient(135deg, var(--chronosphere-light-gray) 0%, #e9ecef 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 12px 12px 0 0;
    padding: 1rem 1.5rem;
}

.game-card .card-body {
    padding: 0;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

#game-container {
    width: 800px;
    height: 600px;
    position: relative;
    background: var(--chronosphere-black);
    display: flex;
    align-items: center;
    justify-content: center;
}

#game-container canvas {
    display: block;
    width: 800px !important;
    height: 600px !important;
    border: none;
    border-radius: 0;
}

.server-info {
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--chronosphere-white);
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    position: absolute;
    bottom: 5px;
    right: 5px;
    z-index: 100;
    font-family: "Poppins", sans-serif;
}

/* Game Instructions Styling */
.control-key {
    background-color: var(--chronosphere-white);
    border: 2px solid var(--chronosphere-light-gray);
    border-radius: 4px;
    padding: 4px 8px;
    font-family: "DM Sans", sans-serif;
    font-weight: bold;
    margin: 0 2px;
    color: var(--chronosphere-black);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.story-section {
    background: linear-gradient(135deg, var(--chronosphere-primary) 0%, var(--chronosphere-secondary) 100%);
    color: var(--chronosphere-white);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.08), 0 0 4px 0 rgba(0, 0, 0, 0.04);
}

.story-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="trees" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23trees)"/></svg>');
    opacity: 0.3;
}

.story-section h4,
.story-section p {
    position: relative;
    z-index: 2;
    color: var(--chronosphere-white) !important;
}



.instruction-card {
    border-left: 4px solid var(--chronosphere-primary);
    background: linear-gradient(135deg, var(--chronosphere-light-gray) 0%, var(--chronosphere-white) 100%);
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.instruction-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.power-up-icon {
    font-size: 1.2em;
    margin-right: 8px;
}

.game-info {
    background: linear-gradient(135deg, var(--chronosphere-black) 0%, var(--chronosphere-dark-gray) 100%);
    color: var(--chronosphere-white);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.08), 0 0 4px 0 rgba(0, 0, 0, 0.04);
}

.game-info .card-title {
    color: var(--chronosphere-white);
    font-family: "DM Sans", sans-serif;
}

/* ===== METRICS DASHBOARD ===== */
.metric-card {
    background: linear-gradient(135deg, var(--chronosphere-light-gray) 0%, var(--chronosphere-white) 100%);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.08), 0 0 4px 0 rgba(0, 0, 0, 0.04);
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 10px 0;
    color: var(--chronosphere-primary);
    font-family: "DM Sans", sans-serif;
}

.metric-title {
    font-size: 1.2rem;
    color: var(--chronosphere-dark-gray);
    font-family: "DM Sans", sans-serif;
    font-weight: 500;
}

/* ===== TABLES ===== */
.table {
    margin-bottom: 0;
    color: var(--chronosphere-dark-gray);
    font-family: "Poppins", sans-serif;
}

.table th {
    font-weight: 600;
    color: var(--chronosphere-black);
    font-family: "DM Sans", sans-serif;
    border-color: var(--chronosphere-light-gray);
}

.table td {
    vertical-align: middle;
    border-color: var(--chronosphere-light-gray);
}

/* ===== PAGINATION CONTROLS ===== */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: var(--chronosphere-primary);
    border-color: var(--chronosphere-light-gray);
}

.page-link:hover {
    color: var(--chronosphere-primary-hover);
    background-color: var(--chronosphere-light-green);
}

/* ===== FOOTER ===== */
footer {
    background-color: var(--chronosphere-black);
    color: var(--chronosphere-white);
    padding: 1.5rem 0;
    margin-top: 2rem;
}

/* ===== HTMX LOADING INDICATOR ===== */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator {
    opacity: 1;
}

.htmx-request.htmx-indicator {
    opacity: 1;
}

/* ===== DASHBOARD STYLES ===== */

/* Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, var(--chronosphere-primary) 0%, var(--chronosphere-secondary) 100%);
    border-radius: 12px;
    padding: 3rem 2rem;
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

/* Override text colors in hero banner */
.hero-banner h1,
.hero-banner h2,
.hero-banner h3,
.hero-banner h4,
.hero-banner h5,
.hero-banner h6,
.hero-banner p,
.hero-banner .lead {
    color: white !important;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="tree" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23tree)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-family: "DM Sans", sans-serif;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    font-family: "Poppins", sans-serif;
}

.hero-actions {
    margin-bottom: 2rem;
}

.hero-stats {
    position: relative;
    z-index: 2;
}

/* Compact Hero Banner */
.compact-hero-banner {
    background: linear-gradient(135deg, var(--chronosphere-primary) 0%, var(--chronosphere-secondary) 100%);
    border-radius: 12px;
    padding: 2rem;
    color: var(--chronosphere-white);
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
    text-align: center;
}

.compact-hero-banner * {
    color: var(--chronosphere-white) !important;
}

.compact-hero-banner .hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.compact-hero-banner .hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

/* Dashboard Cards */
.dashboard-card {
    border: none;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.08), 0 0 4px 0 rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.dashboard-card .card-header {
    background: linear-gradient(135deg, var(--chronosphere-light-gray) 0%, #e9ecef 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.5rem;
}

.dashboard-card .card-header h5 {
    font-weight: 600;
    color: var(--chronosphere-black);
    font-family: "DM Sans", sans-serif;
}

/* Instructions Grid */
.instruction-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.instruction-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--chronosphere-light-gray) 0%, #e9ecef 100%);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.instruction-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.instruction-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chronosphere-primary) 0%, var(--chronosphere-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 1rem;
    flex-shrink: 0;
}

.instruction-text {
    font-size: 0.9rem;
    line-height: 1.4;
    font-family: "Poppins", sans-serif;
    color: var(--chronosphere-dark-gray);
}

/* Status Grid */
.status-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--chronosphere-light-gray) 0%, #e9ecef 100%);
    border-radius: 6px;
}

.status-label {
    font-weight: 600;
    color: var(--chronosphere-black);
    font-family: "DM Sans", sans-serif;
}

.status-value {
    font-family: 'Courier New', monospace;
    color: var(--chronosphere-dark-gray);
}

/* Compact Top Players */
.top-player-compact {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--chronosphere-light-gray) 0%, var(--chronosphere-white) 100%);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.top-player-compact:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.top-player-compact .rank-badge {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    margin-right: 0.75rem;
    font-family: "DM Sans", sans-serif;
    font-weight: 700;
}

.top-player-compact .avatar-md {
    width: 40px;
    height: 40px;
    margin-right: 0.75rem;
}

.top-player-info {
    flex: 1;
    min-width: 0;
}

.top-player-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--chronosphere-black);
    font-family: "DM Sans", sans-serif;
}

.top-player-stats {
    font-size: 0.75rem;
    color: var(--chronosphere-dark-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: "Poppins", sans-serif;
}

.top-player-score {
    text-align: right;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.score-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--chronosphere-primary);
    font-family: "DM Sans", sans-serif;
}

.score-label {
    font-size: 0.7rem;
    color: var(--chronosphere-dark-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: "Poppins", sans-serif;
}

/* Character avatars - for the round PNG images */
.character-avatar {
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.character-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* CSS fallback avatars - for users without characters */
.avatar-placeholder {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: linear-gradient(135deg, var(--chronosphere-primary) 0%, var(--chronosphere-secondary) 100%);
    font-family: "DM Sans", sans-serif;
}

.avatar-placeholder:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Avatar sizes */
.avatar-sm {
    width: 36px;
    height: 36px;
    font-size: 16px;
}

.avatar-md {
    width: 64px;
    height: 64px;
    font-size: 24px;
}

.avatar-lg {
    width: 96px;
    height: 96px;
    font-size: 36px;
}

/* Profile page specific avatar */
.profile-avatar {
    width: 128px;
    height: 128px;
    font-size: 48px;
    margin: 0 auto 20px auto;
    display: block;
}

/* User stats summary section */
.user-stats-summary {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    gap: 15px;
}

.stat-box {
    text-align: center;
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--chronosphere-primary);
    font-family: "DM Sans", sans-serif;
}

.stat-label {
    color: var(--chronosphere-dark-gray);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: "Poppins", sans-serif;
}

/* High scores styling */
.high-score-card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.08), 0 0 4px 0 rgba(0, 0, 0, 0.04);
    border-radius: 10px;
}

.high-score-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.rank-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--chronosphere-white);
    margin-right: 15px;
    flex-shrink: 0;
    font-family: "DM Sans", sans-serif;
}

.rank-1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA000 100%);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.rank-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    box-shadow: 0 0 10px rgba(192, 192, 192, 0.3);
}

.rank-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #A0522D 100%);
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.3);
}

.rank-other {
    background: linear-gradient(135deg, var(--chronosphere-dark-gray) 0%, var(--chronosphere-black) 100%);
}

/* Verification checkmark styling */
.verification-check {
    font-size: 0.8em;
    opacity: 0.8;
    margin-left: 4px;
    color: var(--chronosphere-primary);
}

/* Character info badges */
.character-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    background-color: var(--chronosphere-light-green);
    color: var(--chronosphere-primary);
    font-family: "Poppins", sans-serif;
    font-weight: 500;
}

/* Admin panel styling */
.admin-card {
    transition: all 0.3s ease;
    border-radius: 10px;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.08), 0 0 4px 0 rgba(0, 0, 0, 0.04);
}

.admin-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.admin-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--chronosphere-primary);
}

/* Limit selector for high scores */
.limit-selector {
    width: 100px;
    border: 1px solid var(--chronosphere-light-gray);
    border-radius: 5px;
    padding: 0.5rem;
    font-family: "Poppins", sans-serif;
}

/* Form styling */
.form-control {
    border: 1px solid var(--chronosphere-light-gray);
    border-radius: 5px;
    padding: 0.75rem;
    font-family: "Poppins", sans-serif;
    color: var(--chronosphere-dark-gray);
}

.form-control:focus {
    border-color: var(--chronosphere-primary);
    box-shadow: 0 0 0 0.2rem rgba(40, 165, 97, 0.25);
}

.form-label {
    font-family: "DM Sans", sans-serif;
    font-weight: 500;
    color: var(--chronosphere-black);
}

/* Alert styling */
.alert {
    border-radius: 10px;
    border: none;
    font-family: "Poppins", sans-serif;
}

.alert-success {
    background-color: var(--chronosphere-light-green);
    color: var(--chronosphere-primary);
}

.alert-danger {
    background-color: #fee;
    color: var(--chronosphere-status-error);
}

.alert-info {
    background-color: #e6f3ff;
    color: var(--chronosphere-secondary);
}

/* Badge styling */
.badge {
    font-family: "Poppins", sans-serif;
    font-weight: 500;
    border-radius: 12px;
}

.badge-primary {
    background-color: var(--chronosphere-primary);
}

.badge-secondary {
    background-color: var(--chronosphere-secondary);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-actions .btn {
        display: block;
        margin: 0.5rem 0;
    }
    
    .instruction-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .hero-banner {
        padding: 2rem 1rem;
    }
    
    .user-stats-summary {
        flex-direction: column;
        gap: 10px;
    }
    
    .profile-avatar {
        width: 96px;
        height: 96px;
        font-size: 36px;
    }
    
    .high-score-card .avatar-md {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    h1, .h1 {
        font-size: 1.574rem;
        line-height: 1.2em;
        letter-spacing: -1.68px;
    }

    h2, .h2 {
        font-size: 1.383rem;
        line-height: 1.2em;
        letter-spacing: -1.02px;
    }

    h3, .h3 {
        font-size: 1.296rem;
        line-height: 1.2em;
        letter-spacing: -0.22px;
    }

    h4, .h4 {
        font-size: 1.215rem;
        line-height: 1.2em;
        letter-spacing: -0.22px;
    }

    h5, .h5 {
        font-size: 1rem;
        line-height: 1.2em;
        letter-spacing: 0.19px;
    }

    h6, .h6 {
        font-size: 0.9rem;
        line-height: 1.2em;
        letter-spacing: 0.32px;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .instruction-item {
        padding: 0.75rem;
    }
    
    .instruction-icon {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 1024px) {
    h1, .h1 {
        font-size: 2.3rem;
        line-height: 1.2em;
        letter-spacing: -1.68px;
    }

    h2, .h2 {
        font-size: 1.9rem;
        line-height: 1.2em;
        letter-spacing: -1.02px;
    }

    h3, .h3 {
        font-size: 1.6rem;
        line-height: 1.2em;
        letter-spacing: -0.27px;
    }

    h4, .h4 {
        font-size: 1.4rem;
        line-height: 1.2em;
        letter-spacing: -0.22px;
    }

    h5, .h5 {
        font-size: 1.1rem;
        line-height: 1;
        letter-spacing: 0.19px;
    }

    h6, .h6 {
        font-size: 0.9rem;
        line-height: 1.2em;
        letter-spacing: 0.32px;
    }

    .btn, 
    .fl-button,
    .wp-block-button__link,
    button {
        font-size: 14px;
        line-height: 1.57;
        letter-spacing: 0.14px;
        padding: 8px 16px;
    }
}

/* ===== CHRONOSPHERE BACKGROUND EFFECTS ===== */
body {
    position: relative;
}

body:before {
    content: "";
    position: absolute;
    bottom: 170px;
    left: 0;
    width: 500px;
    height: 500px;
    filter: blur(130px);
    background-image: conic-gradient(from 45deg, var(--chronosphere-primary) 80%, var(--chronosphere-light-green) 10%, var(--chronosphere-secondary) 10%);
    animation: rotate 20s cubic-bezier(0.8, 0.2, 0.2, 0.8) alternate infinite;
    border-radius: 50%;
    z-index: -1;
    opacity: 0.3;
    box-shadow: 0 0 30px 30px var(--chronosphere-primary);
}

@media screen and (max-width: 1024px) {
    body:before {
        width: 250px;
        height: 250px;
    }
}

.Background-right:before {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 500px;
    height: 500px;
    filter: blur(130px);
    background-image: conic-gradient(from 45deg, var(--chronosphere-primary) 80%, var(--chronosphere-light-green) 10%, var(--chronosphere-secondary) 10%);
    animation: rotate 20s cubic-bezier(0.8, 0.2, 0.2, 0.8) alternate infinite;
    border-radius: 50%;
    z-index: -1;
    opacity: 0.3;
    box-shadow: 0 0 30px 30px var(--chronosphere-primary);
}

@media screen and (max-width: 1024px) {
    .Background-right:before {
        width: 250px;
        height: 250px;
        right: 50px;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.Background-right {
    position: relative !important;
}

/* ===== ACCESSIBILITY & UTILITY CLASSES ===== */
.text-center {
    text-align: center;
}

.text-primary {
    color: var(--chronosphere-primary) !important;
}

.text-secondary {
    color: var(--chronosphere-secondary) !important;
}

.bg-light {
    background-color: var(--chronosphere-light-gray) !important;
}

.bg-primary {
    background-color: var(--chronosphere-primary) !important;
}

.bg-secondary {
    background-color: var(--chronosphere-secondary) !important;
}

.bg-purple {
    background-color: var(--chronosphere-purple) !important;
}

/* Dashboard specific styles */
.dashboard-card .card-header h6 {
    font-size: 0.875rem;
    font-weight: 600;
}

.dashboard-card .badge {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
}

.chart-container canvas {
    max-height: 150px !important;
}

.dashboard-card .card-body.p-2 {
    padding: 0.5rem !important;
}

/* Ensure proper contrast for accessibility */
.bg-primary,
.bg-secondary,
.bg-purple {
    color: var(--chronosphere-white) !important;
}

.bg-primary a,
.bg-secondary a {
    color: var(--chronosphere-white) !important;
}

.bg-primary a:hover,
.bg-secondary a:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* ===== MUSIC PLAYER STYLES ===== */
/* Music container inherits sizing from base template's .container */

/* Track list styling - removed duplicate, see line 1739 for actual styles */

.track-item {
    cursor: pointer;
    transition: all 0.2s;
}

.track-item:hover {
    background-color: var(--chronosphere-light-gray);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.track-item.playing {
    background-color: var(--chronosphere-light-green);
    font-weight: 600;
}

.track-item.playing .track-title {
    color: var(--chronosphere-primary);
}

.track-number {
    font-family: "DM Sans", sans-serif;
    font-weight: 500;
    min-width: 2em;
}

.track-title {
    font-family: "DM Sans", sans-serif;
    font-weight: 500;
}

.track-duration {
    font-family: "Poppins", sans-serif;
    font-size: 0.875rem;
}

/* Audio controls */
.audio-controls {
    padding: 0.5rem 0;
}

.audio-controls .btn {
    transition: all 0.2s;
}

.audio-controls .btn:hover {
    transform: scale(1.1);
}

.play-pause-btn {
    width: 60px;
    height: 60px;
}

/* Progress bar */
.music-progress {
    height: 8px;
    cursor: pointer;
}

.music-progress:hover {
    opacity: 0.8;
}

#progressBar {
    transition: width 0.1s linear;
}

/* Volume slider */
.volume-control {
    width: 100px;
}

/* Visualizer */
.visualizer-container {
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1e 50%, #050511 100%);
    position: relative;
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.visualizer-container:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 20px rgba(40, 165, 97, 0.3);
}


/* Fullscreen styles */
.visualizer-container:fullscreen {
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1e 50%, #050511 100%);
    border-radius: 0;
    height: 100vh !important;
    width: 100vw !important;
    max-width: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 9999 !important;
}

.visualizer-container:-webkit-full-screen {
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1e 50%, #050511 100%);
    border-radius: 0;
    height: 100vh !important;
    width: 100vw !important;
    max-width: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 9999 !important;
}

.visualizer-container:-moz-full-screen {
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1e 50%, #050511 100%);
    border-radius: 0;
    height: 100vh !important;
    width: 100vw !important;
    max-width: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 9999 !important;
}

.visualizer-container:-ms-fullscreen {
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f1e 50%, #050511 100%);
    border-radius: 0;
    height: 100vh !important;
    width: 100vw !important;
    max-width: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 9999 !important;
}

/* Ensure canvases fill container in fullscreen */
.visualizer-container:fullscreen .visualizer-canvas,
.visualizer-container:-webkit-full-screen .visualizer-canvas,
.visualizer-container:-moz-full-screen .visualizer-canvas,
.visualizer-container:-ms-fullscreen .visualizer-canvas {
    width: 100% !important;
    height: 100% !important;
}

.visualizer-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="1" fill="white" opacity="0.3"/></svg>') repeat;
    background-size: 100px 100px;
    opacity: 0.03;
    pointer-events: none;
}

.visualizer-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

#particles {
    pointer-events: none;
}

#visualizerMessage {
    opacity: 0.5;
}

/* Current track display */
.current-track-image {
    width: 80px;
    height: 80px;
}

/* Band member images */
.band-member-image {
    max-width: 200px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

/* Band member hover effect */
.band-member-image:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Prevent layout shift on hover by containing the parent */
.music-container .col-md-3 {
    overflow: visible;
}

/* Album cover */
.album-cover {
    max-width: 350px;
}

/* Responsive adjustments for music player */
@media (max-width: 991px) {
    /* Reset flex layout for mobile */
    .music-player-card .col-lg-8,
    .music-player-card .col-lg-4 {
        display: block;
    }
    
    .visualizer-container {
        height: 250px !important;
        min-height: 250px;
    }
    
    .track-list {
        height: 400px !important;
        min-height: 300px;
    }
    
    .album-cover {
        max-width: 250px;
    }
}

@media (max-width: 767px) {
    /* Stack album cover on mobile */
    .hero-banner .row {
        text-align: center;
    }
    
    .album-cover {
        max-width: 200px;
        margin-top: 1.5rem;
    }
    
    /* Adjust visualizer for mobile */
    .visualizer-container {
        height: 200px !important;
        min-height: 200px;
    }
    
    /* Stack track list below player on mobile */
    .audio-controls {
        margin-bottom: 2rem;
    }
    
    /* Smaller controls on mobile */
    .play-pause-btn {
        width: 50px;
        height: 50px;
    }
    
    .audio-controls .btn {
        padding: 0.375rem 0.75rem;
    }
    
    /* Adjust volume control */
    .volume-control {
        width: 80px;
    }
    
    /* Full width track list on mobile */
    .track-list {
        max-height: 400px;
    }
    
    /* Smaller track items on mobile */
    .track-item {
        padding: 0.75rem !important;
    }
    
    .track-number {
        font-size: 0.875rem;
    }
    
    .track-title {
        font-size: 0.9rem;
    }
    
    /* Band member grid adjustments */
    .band-member-image {
        max-width: 150px;
    }
    
    /* Hero banner button adjustments */
    .hero-banner .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    /* Current track display */
    .current-track-image {
        width: 60px;
        height: 60px;
    }
    
    /* Adjust text sizes */
    #currentTrackTitle {
        font-size: 1.25rem;
    }
    
    /* Stack download button on mobile */
    .d-flex.align-items-center {
        flex-wrap: wrap;
    }
    
    #downloadCurrentBtn {
        margin-top: 0.5rem;
    }
}

@media (max-width: 575px) {
    /* Extra small devices */
    .music-container {
        padding: 0 0.5rem;
    }
    
    .hero-banner {
        padding: 2rem 1rem;
    }
    
    .hero-banner .display-4 {
        font-size: 2rem;
    }
    
    .hero-banner .h3 {
        font-size: 1.25rem;
    }
    
    .hero-banner .lead {
        font-size: 1rem;
    }
    
    /* Stack buttons vertically on very small screens */
    .hero-banner .d-flex {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hero-banner .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Band members in 2x2 grid on small screens */
    .band-member-image {
        max-width: 120px;
    }
}

/* Music player layout optimization */
.music-container .dashboard-card {
    margin-bottom: 2rem;
}

/* Music player card specific */
.music-container .music-player-card {
    margin-bottom: 2rem;
}

/* Audio player card specific styles */
.music-container .music-player-card .card-body {
    padding-bottom: 1.5rem;
}

/* Add some spacing to visualizer */
.music-container .visualizer-container {
    margin-bottom: 1rem;
}

/* Music player layout optimization */
.music-player-card .row {
    display: flex;
    align-items: stretch;
    min-height: 600px;
}

/* Left column with player and visualizer */
.music-player-card .col-lg-8 {
    display: flex;
    flex-direction: column;
}

/* Make audio controls take only needed space */
.music-player-card .audio-controls {
    flex-shrink: 0;
}

/* Make visualizer fill remaining space */
.music-player-card .visualizer-container {
    flex-grow: 1;
    height: auto;
    min-height: 350px;
}

/* Right column with track list */
.music-player-card .col-lg-4 {
    display: flex;
    flex-direction: column;
    min-height: 500px; /* Ensure column has minimum height */
}

/* Track list header takes minimal space */
.music-player-card .col-lg-4 > div:first-child {
    flex-shrink: 0;
}

/* Track list fills remaining space */
.music-player-card .track-list {
    flex-grow: 1;
    height: 500px; /* Fixed height for track list */
    overflow-y: auto;
    margin-bottom: 8px; /* Align with visualizer before shadow */
}


/* Track list improvements */
.track-list {
    overflow-y: auto;
    position: relative;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #28a561 #f0f0f0;
}

/* Webkit scrollbar styling */
.track-list::-webkit-scrollbar {
    width: 8px;
}

.track-list::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.track-list::-webkit-scrollbar-thumb {
    background: #28a561;
    border-radius: 4px;
}

.track-list::-webkit-scrollbar-thumb:hover {
    background: #1e8a4d;
}

/* Alternating row colors */
.track-item:nth-child(even) {
    background-color: rgba(40, 165, 97, 0.05);
}

.track-item:nth-child(odd) {
    background-color: rgba(24, 46, 186, 0.03);
}

/* Hover effect */
.track-item:hover {
    background-color: rgba(40, 165, 97, 0.15) !important;
    cursor: pointer;
    transform: translateX(5px);
    transition: all 0.2s ease;
}

/* Currently playing track */
.track-item.playing {
    background-color: rgba(40, 165, 97, 0.2) !important;
    border-left: 4px solid #28a561;
    padding-left: calc(1rem - 4px) !important;
}

/* Scroll hint gradient */
.track-list::after {
    content: '';
}

/* Music notification styles */
.music-notification {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    z-index: 1000;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.music-notification.error {
    border-left: 4px solid #e4260a;
}

.music-notification.info {
    border-left: 4px solid #28a561;
}

.music-notification i {
    font-size: 16px;
}

.music-notification.error i {
    color: #e4260a;
}

.music-notification.info i {
    color: #28a561;
}