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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0c10 url('/images/bg32.jpg') no-repeat center top fixed;
    background-size: cover;
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(5, 7, 12, 0.78);
    z-index: 1;
}

/* =========================================================================
   LOGIN CARD STYLES
   ========================================================================= */
.login-card-modal {
    position: relative;
    z-index: 10;
    background: #151924;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 165, 0, 0.2);
    border-radius: 12px;
    padding: 30px;
    color: #e0e0e0;
    width: 420px;
    max-width: 90vw;
    margin: auto;
}

.login-card-title {
    color: #ffd700;
    font-size: 22px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255,215,0,0.2);
    padding-bottom: 10px;
    text-align: center;
}

.login-error-msg {
    background: rgba(255, 82, 82, 0.15);
    border: 1px solid #ff5252;
    color: #ff5252;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.input-group {
    margin-bottom: 16px;
    text-align: left;
}

.input-label {
    display: block;
    font-size: 13px;
    color: #aaa;
    margin-bottom: 6px;
    font-weight: bold;
}

.custom-input {
    width: 100%;
    padding: 12px 15px;
    background: #080a0f;
    border: 1px solid #2a3142;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.custom-input:focus {
    border-color: #ffd700;
}

.btn-submit {
    width: 100%;
    padding: 13px;
    background: #d4af37;
    color: #0a0c10;
    font-weight: bold;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-submit:hover {
    background: #f3cf55;
}

.login-footer-info {
    font-size: 12px;
    color: #777;
    margin-top: 15px;
    text-align: center;
}

/* =========================================================================
   SERVER SELECTION PAGE STYLES
   ========================================================================= */
body.server-select-page {
    min-height: 100vh;
    background: #0d0f17 url('/images/bg32.jpg') no-repeat center top fixed;
    background-size: cover;
    flex-direction: column;
    color: #fff;
}

body.server-select-page .bg-overlay {
    position: fixed;
    background: rgba(8, 11, 18, 0.88);
}

/* 3-Column Textured Container Box */
.server-select-container {
    position: relative;
    z-index: 10;
    width: 900px;
    max-width: 96vw;
    background: linear-gradient(145deg, rgba(20, 26, 38, 0.96), rgba(12, 16, 24, 0.98));
    border: 1px solid rgba(255, 215, 0, 0.35);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    padding: 25px 30px;
    margin: 20px auto;
}

.user-welcome-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 13px;
}

.user-welcome-bar .uname {
    color: #ffd700;
    font-weight: bold;
}

.btn-logout-sm {
    color: #ff6b6b;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 12px;
    border: 1px solid rgba(255, 107, 107, 0.4);
    border-radius: 4px;
    background: rgba(255, 107, 107, 0.1);
    transition: all 0.2s;
}

.btn-logout-sm:hover {
    background: rgba(255, 107, 107, 0.3);
    color: #fff;
}

/* Gold Serif Title */
.server-title {
    color: #ffd700;
    font-size: 25px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 22px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 0 10px rgba(255, 215, 0, 0.3);
    font-family: Georgia, 'Times New Roman', serif;
}

.server-list-wrapper {
    max-height: 480px;
    overflow-y: auto;
    padding-right: 6px;
}

/* Custom Dark Scrollbar */
.server-list-wrapper::-webkit-scrollbar {
    width: 7px;
}
.server-list-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
}
.server-list-wrapper::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.6);
    border-radius: 4px;
}
.server-list-wrapper::-webkit-scrollbar-thumb:hover {
    background: #ffd700;
}

/* 3-Column Layout Compatible with Coowon Browser (Chromium 27) & Legacy Engines */
.server-grid-3col {
    width: 100%;
    display: block;
    margin: 0;
    padding: 0;
}

.server-grid-3col::after {
    content: "";
    display: table;
    clear: both;
}

.server-card-form {
    float: left;
    width: 31.8%;
    margin-right: 2.3%;
    margin-bottom: 10px;
}

.server-card-form:nth-child(3n) {
    margin-right: 0 !important;
}

/* Compact Server Button Card Styling */
.server-btn-card {
    position: relative;
    width: 100%;
    height: 48px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease-in-out;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 3px 8px rgba(0,0,0,0.5);
    font-family: Arial, Helvetica, sans-serif;
    color: #fff;
    padding: 0 8px;
}

.server-btn-card:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6), 0 5px 12px rgba(0,0,0,0.7), 0 0 10px rgba(255, 215, 0, 0.4);
    border-color: #ffd700;
}

/* NEW Servers Gradient Background (Blue/Cyan Texture) */
.btn-type-new {
    background: linear-gradient(180deg, #249cb8 0%, #156d82 50%, #0d4e5e 100%);
    border-color: #3bbad9;
}

/* HOT Servers Gradient Background (Emerald Green Texture) */
.btn-type-hot {
    background: linear-gradient(180deg, #17937e 0%, #0e6758 50%, #08493e 100%);
    border-color: #23b59b;
}

/* Diagonal Ribbon Badge (Top Left Corner) */
.ribbon-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 44px;
    height: 44px;
    overflow: hidden;
    pointer-events: none;
    z-index: 5;
}

.ribbon {
    position: absolute;
    top: 6px;
    left: -18px;
    width: 60px;
    padding: 1.5px 0;
    text-align: center;
    font-size: 8.5px;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    transform: rotate(-45deg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 0.5px;
}

.ribbon-new {
    background: linear-gradient(135deg, #ff2a55 0%, #b80024 100%);
}

.ribbon-hot {
    background: linear-gradient(135deg, #ff7b00 0%, #d44d00 100%);
}

.server-btn-text {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 5px rgba(0,0,0,0.6);
    letter-spacing: 0.3px;
    z-index: 2;
    text-align: center;
    padding-left: 12px;
}

/* =========================================================================
   FLASH GAME PAGE STYLES
   ========================================================================= */
body.flash-game-page {
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: block;
    font-family: Arial, sans-serif;
}

#flash-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: #000;
}
