@import url('https://fonts.googleapis.com/css2?family=Vend+Sans&display=swap');

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

:root {
    --purple: #a855f7;
    --purple-light: #c084fc;
    --purple-glow: rgba(168, 85, 247, 0.4);
    --black: #000000;
    --white: #ffffff;
    --gray: #666666;
    --border-radius: 8px;
}

body {
    font-family: 'Vend Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--black);
    color: var(--white);
    min-height: 100vh;
    font-size: 14px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Logo */
.logo {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: bold;
    letter-spacing: 4px;
    text-align: center;
    margin-bottom: 5px;
    user-select: none;
}

/* Auth Section */
.auth-container {
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border: 2px solid var(--white);
    border-radius: var(--border-radius);
    background: var(--black);
    box-shadow: 0 0 30px var(--purple-glow);
    transition: box-shadow 0.3s ease;
}

.auth-box.error {
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
}

.auth-box input {
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 16px;
    background: var(--black);
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    color: var(--white);
    font-family: 'Vend Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.auth-box input::placeholder {
    color: var(--gray);
}

.auth-box input:focus {
    border-color: var(--purple);
}

.auth-toggle {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--gray);
}

.link {
    color: var(--white);
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
}

.link:hover {
    color: var(--purple);
}

/* Buttons */
.purple-btn {
    background: var(--purple);
    color: var(--white);
    border: none;
    padding: 14px 28px;
    border-radius: var(--border-radius);
    font-family: 'Vend Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.purple-btn.uploading {
    background: #7c3aed;
    cursor: default;
    box-shadow: none;
}

.purple-btn.uploading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress, 0%);
    background: var(--purple);
    transition: width 0.4s ease;
    border-radius: var(--border-radius);
    z-index: 0;
}

.purple-btn.uploading span {
    position: relative;
    z-index: 1;
}

.purple-btn:hover {
    box-shadow: 0 0 20px var(--purple-glow), 0 0 40px var(--purple-glow);
    transform: translateY(-1px);
}

.purple-btn:active {
    transform: translateY(0);
}

.purple-btn.full-width {
    width: 100%;
}

.small-btn {
    background: transparent;
    color: var(--white);
    border: 1px solid var(--white);
    padding: 8px 16px;
    border-radius: var(--border-radius);
    font-family: 'Vend Sans', sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.small-btn:hover {
    background: var(--white);
    color: var(--black);
}

/* App Section */
.app-container {
    animation: fadeIn 0.3s ease;
}

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

/* Logout Button */
.logout-btn-fixed {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    color: var(--white);
    border: 1px solid var(--white);
    padding: 8px 16px;
    border-radius: var(--border-radius);
    font-family: 'Vend Sans', sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 1000;
    -webkit-appearance: none;
    appearance: none;
}

.logout-btn-fixed:hover {
    background: var(--white);
    color: var(--black);
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    font-size: 13px;
}

#username {
    white-space: nowrap;
}

.storage-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.quota-bar-inline {
    width: 180px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.quota-fill {
    height: 100%;
    background: var(--purple);
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 3px;
    position: absolute;
    left: 0;
}

.quota-pending {
    height: 100%;
    background: #f59e0b;
    width: 0%;
    transition: width 0.3s ease, left 0.3s ease;
    border-radius: 3px;
    position: absolute;
    opacity: 0.7;
}

.quota-fill.warning {
    background: #f59e0b;
}

.quota-fill.danger {
    background: #ef4444;
}

.storage-text {
    font-size: 12px;
    color: var(--gray);
    white-space: nowrap;
}

.pending-storage {
    color: #f59e0b;
    font-weight: 600;
}

.user-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    min-width: auto;
}

.btn-icon {
    width: 16px;
    height: 16px;
    filter: invert(1);
}

.icon-btn:hover .btn-icon {
    filter: invert(0);
}

/* Tools Navigation */
.tools-nav {
    position: relative;
    display: flex;
    gap: 0;
    padding: 16px 20px;
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--purple) transparent;
}

.tools-nav::before,
.tools-nav::after {
    content: '';
    position: sticky;
    display: block;
    width: 60px;
    height: 100%;
    flex-shrink: 0;
    pointer-events: none;
    z-index: 1;
}

.tools-nav::before {
    left: 0;
    background: linear-gradient(to right, var(--black) 0%, var(--black) 20px, transparent 100%);
    margin-right: -60px;
}

.tools-nav::after {
    right: 0;
    background: linear-gradient(to left, var(--black) 0%, var(--black) 20px, transparent 100%);
    margin-left: -60px;
}

.tools-nav::-webkit-scrollbar {
    height: 2px;
}

.tools-nav::-webkit-scrollbar-track {
    background: transparent;
}

.tools-nav::-webkit-scrollbar-thumb {
    background: var(--purple);
    border-radius: 1px;
}

.tools-nav::-webkit-scrollbar-thumb:hover {
    background: var(--purple-light);
}

.tool-btn {
    flex-shrink: 0;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    color: var(--white);
    font-family: 'Vend Sans', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    margin-right: 12px;
}

.tool-btn:last-child {
    margin-right: 0;
}

.tool-btn:hover {
    background: var(--white);
    color: var(--black);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.tool-btn.active {
    background: var(--purple);
    border-color: var(--purple);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Games view centered layout */
#gamesView {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
    grid-template-columns: 1fr;
}

.game-selection-panel,
.game-play-panel {
    width: 100%;
    max-width: 600px;
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
}

.game-selection-panel h2 {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .game-selection-panel,
    .game-play-panel {
        padding: 16px;
    }
}

/* Upload Section */
.upload-section,
.items-section {
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
}

.upload-section h2,
.items-section h2 {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Items header with reload button */
.items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.items-header h2 {
    margin-bottom: 0;
}

.reload-btn {
    background: transparent;
    border: 1px solid var(--white);
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reload-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px var(--purple-glow);
}

.reload-btn img {
    width: 18px;
    height: 18px;
    transition: transform 0.6s ease;
}

.reload-btn.spinning img {
    animation: spin-counterclockwise 0.6s ease;
}

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

/* Tabs */
.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    color: var(--white);
    font-family: 'Vend Sans', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    background: var(--purple);
    border-color: var(--purple);
}

.tab-content {
    animation: fadeIn 0.2s ease;
}

/* File Drop Zone */
.file-drop-zone {
    border: 2px dashed var(--white);
    border-radius: var(--border-radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
}

.file-drop-zone:hover {
    border-color: var(--purple);
    background: rgba(168, 85, 247, 0.05);
}

.file-drop-zone.drag-over {
    border-color: var(--purple);
    background: rgba(168, 85, 247, 0.1);
    box-shadow: 0 0 20px var(--purple-glow);
}

.file-drop-zone p {
    font-size: 13px;
    color: var(--gray);
}

.file-preview {
    padding: 16px;
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    font-size: 13px;
}

.file-preview img {
    max-width: 100%;
    border-radius: var(--border-radius);
    margin-top: 8px;
}

/* Zip Options */
.zip-options {
    margin-bottom: 16px;
}

.zip-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 12px;
}

.zip-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--purple);
}

.zip-checkbox span {
    user-select: none;
}

.zip-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 28px;
}

.zip-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--black);
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    color: var(--white);
    font-family: 'Vend Sans', sans-serif;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.zip-input::placeholder {
    color: var(--gray);
}

.zip-input:focus {
    border-color: var(--purple);
}

/* Share Options */
.share-options {
    margin-bottom: 16px;
}

.share-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.share-input-row .zip-input {
    flex: 1;
}

.lock-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lock-toggle:hover {
    opacity: 0.8;
}

.lock-toggle img {
    width: 20px;
    height: 20px;
}


/* Text Input */
textarea {
    width: 100%;
    padding: 14px 18px;
    background: var(--black);
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    color: var(--white);
    font-family: 'Vend Sans', sans-serif;
    font-size: 14px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 16px;
}

textarea::placeholder {
    color: var(--gray);
}

textarea:focus {
    border-color: var(--purple);
}

/* URL Shortener */
.url-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--black);
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    color: var(--white);
    font-family: 'Vend Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 16px;
}

.url-input::placeholder {
    color: var(--gray);
}

.url-input:focus {
    border-color: var(--purple);
}

.url-input[type="number"]::-webkit-outer-spin-button,
.url-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.url-input[type="number"] {
    -moz-appearance: textfield;
}

/* Dice Roller */
.dice-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dice-controls label {
    font-size: 12px;
    color: var(--gray);
    margin-top: 8px;
}

.dice-result {
    padding: 24px;
    border: 1px solid var(--purple);
    border-radius: var(--border-radius);
    background: rgba(168, 85, 247, 0.05);
}

#base64Output textarea {
    width: 100%;
    min-height: 300px;
}

/* QR Code */
.qr-output {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

#qrCanvas {
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    background: var(--white);
    padding: 16px;
}


.result-total {
    text-align: center;
    margin-bottom: 24px;
}

.total-label {
    display: block;
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 8px;
}

.total-value {
    display: block;
    font-size: 48px;
    font-weight: bold;
    color: var(--purple-light);
}

.individual-rolls {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

.rolls-label {
    display: block;
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 12px;
}

.rolls-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.roll-item {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
}

/* Select */
.styled-select {
    width: 100%;
    padding: 12px 18px;
    background: var(--black);
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    color: var(--white);
    font-family: 'Vend Sans', sans-serif;
    font-size: 13px;
    cursor: pointer;
    outline: none;
}

.styled-select:focus {
    border-color: var(--purple);
}

/* Items List */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item-card {
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    padding: 16px;
    transition: all 0.2s;
    overflow: hidden;
}

.item-card.url-highlight {
    border-color: var(--purple) !important;
    box-shadow: 0 0 15px var(--purple-glow);
    transition: all 0.3s ease;
}

.item-card.clickable {
    cursor: pointer;
}

.item-card.clickable:hover {
    border-color: var(--purple);
    box-shadow: 0 0 15px var(--purple-glow);
    transform: translateX(2px);
}

.item-card.text-item {
    border-left: 3px solid var(--purple);
}

.item-image-preview {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-top: 12px;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.item-name {
    font-weight: 600;
    font-size: 13px;
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.burn-badge {
    display: inline-block;
    background: var(--purple);
    color: var(--white);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Downloader */
.dl-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.dl-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--purple);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.dl-progress-bar.pulsing {
    width: 100%;
    animation: dl-pulse 1.2s ease-in-out infinite;
}

@keyframes dl-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.dl-status-label {
    font-size: 13px;
    color: var(--gray);
    margin: 0;
}

.dl-ready-filename {
    font-size: 13px;
    color: var(--white);
    margin-bottom: 16px;
    word-break: break-all;
}

.dl-error-msg {
    font-size: 13px;
    color: #ef4444;
    margin: 0;
}

.item-time {
    font-size: 11px;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.time-icon {
    width: 12px;
    height: 12px;
    opacity: 0.6;
}

.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    gap: 12px;
}

.item-content {
    font-size: 12px;
    color: var(--gray);
    word-break: break-all;
    overflow-wrap: anywhere;
    min-width: 0;
    margin-bottom: 8px;
}

.item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.item-actions button {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    color: var(--white);
    font-family: 'Vend Sans', sans-serif;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.item-actions button:hover {
    background: var(--white);
    color: var(--black);
}

.item-actions button.delete-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: var(--white);
}

.item-actions button.open-note-btn {
    background: var(--purple);
    border-color: var(--purple);
    font-weight: bold;
}

.note-lock-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-left: 6px;
}

.item-actions button.open-note-btn:hover {
    background: var(--purple-light);
    border-color: var(--purple-light);
    color: var(--white);
}

.empty-state {
    text-align: center;
    color: var(--gray);
    padding: 40px 20px;
    font-size: 13px;
}

/* Status Message */
.status-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 24px;
    background: var(--purple);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
    font-size: 13px;
    max-width: 300px;
}

@keyframes slideIn {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.status-message.error {
    background: #ef4444;
}

.status-message.success {
    background: #10b981;
}

/* Loading Spinner */
.loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    gap: 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
}

.loading-spinner svg {
    width: 100%;
    height: 100%;
    stroke: var(--purple);
}

/* Detail View */
.detail-view {
    animation: fadeIn 0.3s ease;
}

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

.back-btn {
    background: transparent;
    border: 1px solid var(--white);
    color: var(--white);
    padding: 8px 16px;
    border-radius: var(--border-radius);
    font-family: 'Vend Sans', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.back-btn:hover {
    background: var(--white);
    color: var(--black);
}

.detail-content {
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 20px;
}

.detail-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    font-size: 14px;
    line-height: 1.6;
}

.detail-text a {
    color: var(--purple-light);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s;
}

.detail-text a:hover {
    color: var(--purple);
}

.detail-actions {
    display: flex;
    gap: 12px;
}

.detail-actions button {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    color: var(--white);
    font-family: 'Vend Sans', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.detail-actions button:hover {
    background: var(--white);
    color: var(--black);
}

.detail-actions button.delete-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: var(--white);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    body {
        font-size: 13px;
    }

    .container {
        padding: 16px;
    }

    .logo {
        margin-bottom: 5px;
        padding-top: 10px;
    }

    .auth-box {
        padding: 30px 24px;
    }

    .upload-section,
    .items-section {
        padding: 20px;
    }

    .file-drop-zone {
        padding: 30px 16px;
    }

    /* Fixed logout button on mobile */
    .logout-btn-fixed {
        top: 16px;
        right: 16px;
        padding: 6px 12px;
        font-size: 11px;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background: transparent !important;
        border: 1px solid var(--white) !important;
        color: var(--white) !important;
        border-radius: var(--border-radius) !important;
    }

    .logout-btn-fixed:hover {
        background: var(--white) !important;
        color: var(--black) !important;
    }
}

/* Games */
.game-menu-btn {
    width: 100%;
    padding: 16px;
    margin-bottom: 12px;
    background: transparent;
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    color: var(--white);
    font-family: 'Vend Sans', sans-serif;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.game-menu-btn:hover {
    background: var(--purple);
    border-color: var(--purple);
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding: 0 8px;
    box-sizing: border-box;
}

.game-canvas {
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    background: var(--black);
    cursor: pointer;
    max-width: 100%;
    width: 100%;
    height: auto;
}

@media (max-width: 968px) {
    .game-container {
        padding: 0;
    }
}

.game-header {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
}

.game-score {
    font-size: 18px;
    font-weight: bold;
    color: var(--purple-light);
}

.game-controls {
    display: flex;
    gap: 8px;
}

.game-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--white);
    border-radius: var(--border-radius);
    color: var(--white);
    font-family: 'Vend Sans', sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.game-btn:hover {
    background: var(--purple);
    border-color: var(--purple);
}

.tictactoe-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 300px;
    margin: 20px auto;
}

.tictactoe-cell {
    width: 100%;
    aspect-ratio: 1;
    background: transparent;
    border: 2px solid var(--white);
    border-radius: var(--border-radius);
    color: var(--white);
    font-family: 'Vend Sans', sans-serif;
    font-size: 48px;
    cursor: pointer;
    transition: all 0.2s;
}

.tictactoe-cell:hover:not(:disabled) {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--purple);
}

.tictactoe-cell:disabled {
    cursor: not-allowed;
}

.game-status {
    text-align: center;
    font-size: 18px;
    margin: 20px 0;
    color: var(--purple-light);
    font-weight: bold;
}

/* Easter Egg Floating Animation */
.easter-egg-float {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.easter-egg-float.hidden {
    opacity: 0;
    pointer-events: none;
}

.easter-egg-image {
    max-width: min(400px, 80vw);
    max-height: min(400px, 60vh);
    width: auto;
    height: auto;
    border-radius: var(--border-radius);
    border: 3px solid var(--purple);
    box-shadow: 0 0 40px var(--purple-glow), 0 10px 30px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    display: block;
}

.easter-egg-text {
    font-size: clamp(18px, 3vw, 28px);
    color: var(--white);
    text-align: center;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 0 20px var(--purple-glow), 0 0 10px rgba(138, 43, 226, 0.8),
                 2px 2px 8px rgba(0, 0, 0, 0.9);
    padding: 8px 16px;
    background: rgba(138, 43, 226, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    border: 1px solid rgba(138, 43, 226, 0.4);
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

@keyframes floatGentle {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(var(--float-rotation));
    }
    25% {
        transform: translateY(-15px) translateX(8px) rotate(calc(var(--float-rotation) + 2deg));
    }
    50% {
        transform: translateY(-8px) translateX(-5px) rotate(var(--float-rotation));
    }
    75% {
        transform: translateY(-20px) translateX(10px) rotate(calc(var(--float-rotation) - 2deg));
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.7) rotate(var(--float-rotation));
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(var(--float-rotation));
    }
}

@keyframes fadeOutScale {
    from {
        opacity: 1;
        transform: scale(1) rotate(var(--float-rotation));
    }
    to {
        opacity: 0;
        transform: scale(0.85) rotate(var(--float-rotation));
    }
}

@media (max-width: 968px) {
    .easter-egg-image {
        max-width: 85vw;
        max-height: 50vh;
    }

    .easter-egg-text {
        font-size: clamp(16px, 4vw, 24px);
        padding: 6px 12px;
    }
}
