:root {
    --bg-gradient: linear-gradient(135deg, #240046 0%, #7b2cbf 100%);
    --card-bg: rgba(255, 255, 255, 0.1);
    --primary: #ff9e00;
    /* Orange */
    --secondary: #00b4d8;
    /* Blue */
    --accent: #ff006e;
    /* Pink */
    --text: #ffffff;
    --font-heading: 'Fredoka One', cursive;
    --font-body: 'Nunito', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    background-color: #0b001a;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(138, 43, 226, 0.2) 0%, rgba(0, 0, 0, 0) 70%),
        linear-gradient(0deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.2) 2px);
    background-size: 100% 100%, 100% 4px;
    font-family: 'Nunito', sans-serif;
    color: #fff;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Added for Vertical Centering */
    overflow-x: hidden;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
}

/* Navigation Menu */
.nav-dropdown {
    position: absolute;
    top: 70px;
    right: 20px;
    background: rgba(10, 5, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    width: 250px;
    z-index: 200;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transform-origin: top right;
    animation: slideDown 0.2s ease-out;
}

.nav-dropdown.hidden {
    display: none;
}

@keyframes slideDown {
    from {
        transform: scaleY(0);
        opacity: 0;
    }

    to {
        transform: scaleY(1);
        opacity: 1;
    }
}

#burger-btn {
    padding: 5px 10px;
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Header */
header {
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    box-sizing: border-box;
    position: absolute;
    /* Fixed header to allow body center */
    top: 0;
    z-index: 20;
}

h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--primary);
    text-shadow: 3px 3px 0px #3c096c;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Buttons */
button {
    font-family: var(--font-heading);
    border: none;
    border-radius: 50px;
    padding: 12px 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s, filter 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.connect-btn {
    background: var(--secondary);
    color: white;
    box-shadow: 0 4px 0 #0077b6;
}

.connect-btn.connected {
    background: #2d6a4f;
    box-shadow: 0 4px 0 #1b4332;
}

.connect-btn:active,
.cyber-btn:active,
.spin-btn:active {
    transform: translateY(4px);
    box-shadow: none !important;
}

.cyber-btn {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 0 #e85d04;
    font-size: 0.9rem;
}

.cyber-btn:hover {
    filter: brightness(1.1);
}

.cyber-btn.warning {
    background: var(--accent);
    box-shadow: 0 4px 0 #c9184a;
}

.spin-btn {
    background: linear-gradient(to bottom, #ff006e, #c9184a);
    color: white;
    font-size: 1.8rem;
    padding: 20px 60px;
    box-shadow: 0 8px 0 #800f2f;
    margin-top: 30px;
    width: 100%;
    max-width: 400px;
}

.spin-btn:disabled {
    background: #6c757d;
    box-shadow: none;
    cursor: not-allowed;
    transform: translateY(8px);
    opacity: 0.7;
}

/* Admin Layout */
.admin-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    margin-top: 50px;
    width: 600px;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    /* Center text and inline-block entries */
}

.admin-panel h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #ff9e00;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

/* Layout */
main {
    width: 90%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 40px 0;
    flex: 1;
}

/* Modules */
.admin-panel,
.game-container {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 40px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

/* Default hidden to prevent flicker - JS will show if admin */
.admin-panel {
    display: none;
    border: 2px dashed var(--accent);
    background: rgba(60, 9, 108, 0.4);
}

.game-container {
    text-align: center;
}

h3 {
    font-family: var(--font-heading);
    color: white;
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
    text-align: left;
}

.game-container h3 {
    text-align: center;
    color: var(--secondary);
}

/* Inputs */
.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.cyber-input {
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-family: var(--font-body);
    font-weight: bold;
    font-size: 1rem;
    flex: 1;
    transition: all 0.2s;
}

.cyber-input:focus {
    outline: none;
    border-color: var(--secondary);
    background: rgba(0, 0, 0, 0.4);
}

.cyber-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Wheel */
.wheel-wrapper {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 0 auto;
    border-radius: 50%;
    border: 12px solid white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background: #ffffff;
    overflow: hidden;
}

canvas {
    width: 100%;
    height: 100%;
}

.pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid var(--accent);
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.3));
    z-index: 10;
}

.status-text {
    font-family: var(--font-heading);
    margin-top: 20px;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
}

/* NFT Gallery */
.nft-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 15px;
    margin: 20px 0;
    max-height: 250px;
    overflow-y: auto;
    padding: 5px;
}

.nft-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.nft-card:hover {
    transform: translateY(-5px);
    border-color: var(--secondary);
    background: rgba(0, 180, 216, 0.2);
}

.nft-card.selected {
    border-color: var(--primary);
    background: rgba(255, 158, 0, 0.2);
    box-shadow: 0 0 15px rgba(255, 158, 0, 0.3);
}

.nft-card img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.2);
}

/* Logs */
.console-log {
    width: 100%;
    background: #10002b;
    color: #00ff9d;
    font-family: 'Courier New', monospace;
    padding: 20px;
    border-radius: 15px;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    /* Hidden by default */
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* V3 Enhancements */

/* Wins Feed */
.wins-feed {
    margin-top: 30px;
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 252, 0.2);
    width: 400px;
    max-width: 90%;
    margin-bottom: 50px;
}

#wins-list {
    max-height: 150px;
    overflow-y: auto;
}

.win-item {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
}

.win-item:last-child {
    border-bottom: none;
}

.win-item a {
    color: #f72585;
    text-decoration: none;
}

/* Admin Overlay Mode */
.admin-panel.hidden {
    display: none !important;
}

.admin-panel:not(.hidden) {
    display: block !important;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 0, 40, 0.95);
    z-index: 1000;
    margin: 0;
    max-height: 90vh;
    overflow-y: auto;
    border: 2px solid #ff006e;
    box-shadow: 0 0 50px rgba(255, 0, 110, 0.5);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.close-icon {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.close-icon:hover {
    transform: scale(1.2);
    color: #ff006e;
}

/* Mobile & Responsive */
@media (max-width: 768px) {
    header {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .wheel-wrapper {
        width: 300px;
        height: 300px;
    }

    .spin-btn {
        padding: 15px 40px;
        font-size: 1.4rem;
        width: 80%;
    }

    .modal-content {
        width: 90%;
        padding: 20px;
    }

    .win-image {
        width: 150px;
        height: 150px;
    }

    .input-group {
        flex-direction: column;
    }

    main {
        width: 95%;
        padding: 20px 0;
    }

    .admin-panel {
        width: 95%;
        padding: 15px;
    }
}

@media (max-width: 400px) {
    .wheel-wrapper {
        width: 250px;
        height: 250px;
    }

    h1 {
        font-size: 1.2rem;
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal.hidden {
    display: none;
    opacity: 0;
}

.modal-content {
    background: #240046;
    background: linear-gradient(135deg, #240046 0%, #3c096c 100%);
    border: 2px solid #ff9e00;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 0 50px rgba(255, 158, 0, 0.5);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.win-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 15px;
    border: 3px solid #0ff0fc;
    margin: 15px 0;
    box-shadow: 0 0 20px rgba(15, 240, 252, 0.3);
}

.tx-link {
    color: #0ff0fc;
    font-family: 'Nunito';
    font-size: 0.9rem;
    text-decoration: underline;
    display: block;
    margin-top: 10px;
}
/* --- HORIZONTAL TICKER STYLES (V3.1) --- */
.wheel-wrapper {
    width: 100%;
    max-width: 1000px;
    height: 350px;
    position: relative;
    margin: 0 auto;
    background: #121212;
    border-radius: 20px;
    border: 4px solid #333;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.5), inset 0 0 100px rgba(0,0,0,0.8);
}
.pointer { display: none !important; }
#wheel-canvas { width: 100%; height: 100%; display: block; }
