:root {
    --sega-dark: #2a2a2a;
    --sega-brown: #8b7355;
    --sega-light: #d9c8a9;
    --sega-accent: #c84c0c;
    --sega-blue: #4a6baf;
    --sega-green: #5a8c5a;
    --sega-red: #b54a4a;
    --sega-yellow: #d9b44a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #3a2c1e, #1a1610);
    font-family: 'Press Start 2P', cursive;
    color: var(--sega-light);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.5;
    image-rendering: pixelated;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--sega-dark);
    border: 8px solid var(--sega-brown);
    border-radius: 4px;
    box-shadow: 
0 0 0 4px #1a1610,
0 8px 0 4px #000,
inset 0 0 20px rgba(0, 0, 0, 0.5);
    padding: 20px;
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border: 4px solid var(--sega-accent);
    border-radius: 8px;
    pointer-events: none;
    z-index: -1;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 4px solid var(--sega-brown);
    position: relative;
}

h1 {
    font-size: 1.8rem;
    color: var(--sega-yellow);
    text-shadow: 3px 3px 0 #000;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 0.7rem;
    color: var(--sega-light);
    margin-bottom: 15px;
}

.sega-logo {
    display: inline-block;
    background: var(--sega-blue);
    color: white;
    padding: 5px 10px;
    font-size: 0.8rem;
    border-radius: 3px;
    margin-top: 10px;
    box-shadow: 2px 2px 0 #000;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .main-content {
grid-template-columns: 1fr;
    }
}

.sidebar {
    background: #1a1610;
    border: 4px solid var(--sega-brown);
    border-radius: 4px;
    padding: 15px;
}

.nav-btn {
    display: block;
    width: 100%;
    background: var(--sega-dark);
    border: 3px solid var(--sega-brown);
    color: var(--sega-light);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    padding: 12px 10px;
    margin-bottom: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    position: relative;
}

.nav-btn:hover {
    background: #3a3a3a;
    transform: translateY(-2px);
    box-shadow: 0 4px 0 #000;
}

.nav-btn.active {
    background: var(--sega-accent);
    color: white;
    border-color: #e65c1a;
}

.nav-btn i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.content-area {
    background: #1a1610;
    border: 4px solid var(--sega-brown);
    border-radius: 4px;
    padding: 20px;
    min-height: 500px;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.section-title {
    font-size: 1rem;
    color: var(--sega-yellow);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--sega-brown);
    text-align: center;
}

.input-group {
    margin-bottom: 20px;
}

textarea, input {
    width: 100%;
    background: #0a0a0a;
    border: 3px solid var(--sega-brown);
    color: var(--sega-light);
    font-family: 'latin-ext', cursive;
    font-size: 0.7rem;
    padding: 12px;
    resize: vertical;
    image-rendering: pixelated;
}

textarea {
    min-height: 120px;
}

textarea:focus, input:focus {
    outline: none;
    border-color: var(--sega-accent);
}

.btn-long-text {
    font-size: 0.42rem !important;
    white-space: nowrap;
    padding: 8px 6px;
    min-width: 220px; /* Adjust this value until text fits */
}

.btn-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.btn {
    background: var(--sega-dark);
    border: 3px solid;
    color: var(--sega-light);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    padding: 10px 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 0 #000;
}

.btn-primary {
    border-color: var(--sega-blue);
}

.btn-primary:hover {
    background: var(--sega-blue);
    color: white;
}

.btn-secondary {
    border-color: var(--sega-green);
}

.btn-secondary:hover {
    background: var(--sega-green);
    color: white;
}

.btn-danger {
    border-color: var(--sega-red);
}

.btn-danger:hover {
    background: var(--sega-red);
    color: white;
}

.btn-warning {
    border-color: var(--sega-yellow);
}

.btn-warning:hover {
    background: var(--sega-yellow);
    color: #000;
}

.replace-group {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    margin: 15px 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.category-card {
    background: var(--sega-dark);
    border: 3px solid var(--sega-brown);
    border-radius: 4px;
    padding: 15px;
}

.category-title {
    font-size: 0.7rem;
    color: var(--sega-yellow);
    margin-bottom: 10px;
    text-align: center;
    border-bottom: 2px solid var(--sega-brown);
    padding-bottom: 5px;
}

.category-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-btn {
    background: #2a2a2a;
    border: 2px solid var(--sega-brown);
    color: var(--sega-light);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    padding: 8px 5px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.category-btn:hover {
    background: #3a3a3a;
    transform: translateY(-1px);
}

footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 4px solid var(--sega-brown);
    font-size: 0.6rem;
    color: var(--sega-light);
}

.pixel-corner {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--sega-accent);
}

.corner-tl {
    top: -5px;
    left: -5px;
}

.corner-tr {
    top: -5px;
    right: -5px;
}

.corner-bl {
    bottom: -5px;
    left: -55px;
}

.corner-br {
    bottom: -5px;
    right: -5px;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
to bottom,
rgba(0,0,0,0) 50%,
rgba(0,0,0,0.1) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 100;
    opacity: 0.3;
}

.sega-border {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 15px solid transparent;
    border-image: linear-gradient(45deg, var(--sega-blue), var(--sega-accent), var(--sega-yellow)) 1;
    pointer-events: none;
    z-index: -1;
}

/* Custom SEGA Retro Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--sega-dark);
    border: 8px solid var(--sega-brown);
    border-radius: 4px;
    padding: 30px;
    min-width: 400px;
    box-shadow: 
        0 0 0 4px #1a1610,
        0 8px 0 4px #000,
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

.modal-title {
    color: var(--sega-yellow);
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 2px 2px 0 #000;
}

.modal-input {
    width: 100%;
    background: #0a0a0a;
    border: 3px solid var(--sega-brown);
    color: var(--sega-light);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.modal-input:focus {
    outline: none;
    border-color: var(--sega-accent);
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 24px;
    border: 3px solid;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn.confirm {
    background: var(--sega-green);
    border-color: var(--sega-green);
    color: white;
}

.modal-btn.cancel {
    background: var(--sega-red);
    border-color: var(--sega-red);
    color: white;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 0 #000;
}

/* About Us Section */
.about-content {
    text-align: center;
    padding: 20px;
}

.credits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.credit-card {
    background: var(--sega-dark);
    border: 3px solid var(--sega-brown);
    border-radius: 4px;
    padding: 20px;
    transition: all 0.3s ease;
}

.credit-card:hover {
    transform: translateY(-5px);
    border-color: var(--sega-accent);
    box-shadow: 0 5px 15px rgba(255, 110, 199, 0.3);
}

.credit-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    background: linear-gradient(45deg, var(--sega-blue), var(--sega-accent));
    border-radius: 50%;
    border: 3px solid var(--sega-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.credit-name {
    color: var(--sega-yellow);
    font-size: 0.8rem;
    margin-bottom: 8px;
    text-shadow: 2px 2px 0 #000;
}

.credit-role {
    color: var(--sega-accent);
    font-size: 0.6rem;
    margin-bottom: 10px;
}

.credit-desc {
    color: var(--sega-light);
    font-size: 0.5rem;
    line-height: 1.4;
}

.team-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    color: var(--sega-yellow);
    font-size: 2rem;
    text-shadow: 3px 3px 0 #000;
    display: block;
}

.stat-label {
    color: var(--sega-light);
    font-size: 0.6rem;
    margin-top: 5px;
}

.retro-divider {
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--sega-accent), transparent);
    margin: 30px 0;
    border: none;
}

.final-credits {
    background: var(--sega-blue);
    border: 3px solid var(--sega-yellow);
    padding: 20px;
    margin-top: 30px;
    position: center;
}

.final-credits::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px solid var(--sega-accent);
    pointer-events: none;
}

.made-with {
    color: var(--sega-yellow);
    font-size: 0.7rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 0 #000;
}

.tech-stack {
    color: var(--sega-light);
    font-size: 0.7rem;
    line-height: 1.6;
}

/* Welcome Section */
.welcome-content {
    text-align: center;
    padding: 20px;
}

.welcome-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.welcome-header h3 {
    color: var(--sega-yellow);
    font-size: 1rem;
    text-shadow: 2px 2px 0 #000;
}

.pixel-char {
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-card {
    background: rgba(42, 42, 42, 0.8);
    border: 2px solid var(--sega-brown);
    border-radius: 4px;
    padding: 20px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--sega-accent);
    box-shadow: 0 5px 15px rgba(255, 110, 199, 0.3);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.feature-card h4 {
    color: var(--sega-blue);
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--sega-light);
    font-size: 0.6rem;
    line-height: 1.4;
}

.quick-start {
    margin: 40px 0;
    padding: 20px;
    background: rgba(106, 90, 205, 0.1);
    border: 2px dashed var(--sega-blue);
    border-radius: 4px;
}

.quick-start h3 {
    color: var(--sega-green);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.steps {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-number {
    background: var(--sega-accent);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.step p {
    color: var(--sega-light);
    font-size: 0.7rem;
    margin: 0;
}

.warning-box {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(181, 74, 74, 0.2);
    border: 2px solid var(--sega-red);
    border-radius: 4px;
    padding: 15px;
    margin-top: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.warning-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.warning-box p {
    color: var(--sega-light);
    font-size: 0.7rem;
    text-align: left;
    margin: 0;
}

.warning-box strong {
    color: var(--sega-yellow);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .steps {
        flex-direction: column;
        gap: 15px;
    }
    
    .welcome-header {
        flex-direction: column;
        gap: 10px;
    }
}

/* Copy Button Styles */
.textarea-container {
    position: relative;
    margin-bottom: 20px;
}

.copy-btn {
    position: absolute;
    bottom: -35px;
    right: 0;
    background: var(--sega-dark);
    border: 2px solid var(--sega-green);
    color: var(--sega-light);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.copy-btn:hover {
    background: var(--sega-green);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 0 #000;
}

.copy-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 0 #000;
}

.copy-btn.copied {
    background: var(--sega-blue);
    border-color: var(--sega-blue);
}

.copy-btn.copied::after {
    content: 'COPIED!';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--sega-blue);
    color: white;
    padding: 3px 6px;
    border-radius: 2px;
    font-size: 0.4rem;
    white-space: nowrap;
}

/* Sound Toggle Button */
.sound-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.sound-btn {
    background: var(--sega-dark);
    border: 2px solid var(--sega-blue);
    color: var(--sega-light);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.sound-btn:hover {
    background: var(--sega-blue);
    transform: translateY(-2px);
    box-shadow: 0 3px 0 #000;
}

.sound-btn.muted {
    border-color: var(--sega-red);
    opacity: 0.7;
}

.sound-btn.muted:hover {
    background: var(--sega-red);
}