/* Local font loading (no external Google Fonts calls) */
@font-face {
    font-family: 'Roboto';
    src: url('font.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --color1: #FF9EAA; /* Bubblegum pink */
    --color2: #8FD3FF; /* Sky blue */
    --color3: #FFE08F; /* Lemon yellow */
    --color4: #B5FF8F; /* Mint green */
    --color5: #f3810b;
}

/* =============================================================================
   HARDCODED COLORS AND FONTS
   ============================================================================= */

/* Body and global colors */
body {
    background-color: #e3e6f5 !important;
    font-family: Roboto, sans-serif;
}

/* Navigation buttons - left three (Rules, Characters, Players) */
.nav-button {
    color: #ffffff !important;
    background-color: #8FD3FF !important;
    font-size: 13px !important;
}

/* Profile and Login button - far right */
.nav-button.profile-btn {
    color: #ffffff !important;
    background-color: #f9a1b0 !important;
    font-size: 13px !important;
}

.nav-button.login-btn,
.auth-form .save-btn {
    color: #ffffff !important;
    background-color: #f9a1b0 !important;
    font-size: 13px !important;
}

/* Rules page*/
/* .home-page,
.home-page *,
.rules-content {
    font-family: Roboto, cursive !important;
} */

.rules-content,
.rules-content h2,
.rules-content h3,
.rules-content p,
.rules-content li {
    color: #000000 !important;
}

.rules-content {
    background-color: #fff3d6 !important;
}

/* Characters page */
.characters-page,
.characters-page *,
.character-card {
    font-family: Roboto, sans-serif !important;
}

.characters-page .character-card .character-title,
.characters-page .character-card .character-desc,
.characters-page .character-card .character-meta,
.characters-page .character-card .character-meta .meta-username {
    color: #ffffff !important;
}

.characters-bg {
    background-color: #fff3d6 !important;
}

/* Character card colors - cycle through 5 colors */
.characters-page .character-card {
    background-color: #AFC1AC !important;
}

.characters-page .character-card:nth-child(5n+1) {
    background-color: #AFC1AC !important;
}

.characters-page .character-card:nth-child(5n+2) {
    background-color: #CAA19C !important;
}

.characters-page .character-card:nth-child(5n+3) {
    background-color: #9DA2C6 !important;
}

.characters-page .character-card:nth-child(5n+4) {
    background-color: #91B7BF !important;
}

.characters-page .character-card:nth-child(5n+5) {
    background-color: #C5B8AE !important;
}

/* Players page */
.players-page,
.players-page *,
.players-table {
    font-family: Roboto, sans-serif !important;
}

.players-table,
.players-table th,
.players-table td,
.player-username-link {
    color: #ffffff !important;
}

.players-container {
    background-color: #fff3d6 !important;
}

/* Players table row colors - cycle through 5 colors */
.players-table tbody tr td {
    background-color: #AFC1AC !important;
}

.players-table tbody tr:nth-child(5n+1) td {
    background-color: #AFC1AC !important;
}

.players-table tbody tr:nth-child(5n+2) td {
    background-color: #CAA19C !important;
}

.players-table tbody tr:nth-child(5n+3) td {
    background-color: #9DA2C6 !important;
}

.players-table tbody tr:nth-child(5n+4) td {
    background-color: #91B7BF !important;
}

.players-table tbody tr:nth-child(5n+5) td {
    background-color: #C5B8AE !important;
}

/* Profile page */
.profile-page,
.profile-page * {
    font-family: Roboto, sans-serif !important;
}

.profile-page .character-title,
.profile-page .character-desc {
    color: #000000 !important;
}

.profile-info-block,
.profile-characters-block {
    background-color: #fff3d6 !important;
}
/* body.profile-page.viewing-other-profile .profile-characters-block {
    padding-top: 15px;
} */
/* Signup/Login page */
.signup-page,
.signup-page *,
.auth-box,
.auth-form input {
    font-family: Roboto, sans-serif !important;
}

.auth-form,
.auth-form input,
.error-message {
    /* color: #333333 !important; */
}

.auth-box {
    background: #ffffff !important;
}

.form-group input {
    border: 3px solid #dee2e6;
    background: #f8f9fa;
    color: #333333;
}

.form-group input:focus {
    border-color: #dee2e6;
}

.auth-form button {
    background: #f9a1b0;
    color: #ffffff;
}

/* Pagination buttons */
.pagination .pagination-btn {
    background: #8FD3FF;
    color: #ffffff;
}

.pagination .pagination-btn:disabled {
    background: #ccc;
    color: #999;
}

* {
    box-sizing: border-box;
}

/* Custom Overlay Scrollbar - Prevents layout shift */
/* Overlay scrollbar that doesn't take up space */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
    -webkit-border-radius: 0;
    border-radius: 0;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    -webkit-border-radius: 10px;
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
}

/* Firefox overlay scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
}

/* Prevent scrollbar from taking up space - use overlay mode */
html {
    overflow-y: overlay; /* Overlay mode for supporting browsers */
    overflow-y: auto; /* Fallback for non-supporting browsers */
}

body {
    overflow-x: hidden; /* Prevent horizontal scrollbar */
}

/* Force overlay scrollbar behavior */
@supports (overflow: overlay) {
    html {
        overflow-y: overlay;
    }
}

/* Alternative: Use scrollbar-gutter for browsers that support it */
@supports (scrollbar-gutter: stable) {
    html {
        scrollbar-gutter: stable;
        overflow-y: auto;
    }
}





html {
    scroll-behavior: smooth;
    
}
@media screen and (min-width: 768px) {
    html {
        margin-right: -15px
    }
}

.container {
    max-width: 400px;  /* Fixed mobile width for all devices */
    width: 100%;
    margin: 10px auto 40px;
    padding: 0px;
}

/* Navbar Styles */
.navbar {
    /* background: white; */
    padding: 15px;
    border-radius: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-button {
    width: 25%;
    background: var(--color2);
    border: none;
    padding: 10px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 2px;
    text-decoration: none;
    text-align: center;
}

/* Main Content */
body {
    min-height: 100vh;
    margin: 0;
}

/* Add a beige background behind the characters container */
.characters-bg {
    /* background: #fff3d6; */
    border-radius: 30px;
    padding: 15px;
    margin: 0px 0;
}

.characters-grid .character-card {
    cursor: default;
    margin-bottom: 10px;
}

.characters-grid .character-card .character-content{
    width: 100%;
    text-align: left;
}

.profile-page .character-card .character-content{
    width: 100%;
    /* text-align: center; */
}
/* .character-card:not(.pending) .character-content {
    height: unset;
} */

.character-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.character-card-title p{
    margin: 5px;
}

.character-card-title .title{
    font-size: 18px;
}

.character-card p, .character-card .time {
    font-size: 14px;
}


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

/* Home Page Styles */

.rules-content {
    background: white;
    padding: 20px;
    border-radius: 30px;
    margin-bottom: 40px;
    line-height: 1.8;
    font-size: 0.65rem;
    color: #333;
}

.rules-content p {
    text-align: justify;
}

.rules-content ul {
    margin: 15px 0;
    padding-left: 25px;
}

.rules-content li {
    margin-bottom: 8px;
}

.download-btn{
    display: flex;
    width: 100%;
    justify-content: center;
}

/* Landing page specific styles */

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #7dcf95 0%, #5fb3d3 100%);
    color: white;
}

.btn-accent {
    background: linear-gradient(135deg, #fdac62 0%, #ff6b6b 100%);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        gap: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    .character-card {
        padding: 15px;
        min-height: auto;
    }
    
    .profile-main {
        flex-direction: column;
    }
    
    .profile-sidebar {
        margin-bottom: 20px;
    }
    
    .rules-content {
        padding: 25px;
    }
}

.pagination {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.no-characters {
    font-style: italic;
    color: #999;
    padding: 10px 0;
}

@media (max-width: 768px) {
    .navbar {
        padding: 10px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .nav-button {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .title {
        font-size: 1.3rem;
    }

    .description {
        font-size: 0.95rem;
    }

    .two-columns {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }


    .character-card-title .avatar {
        display: none;
    }

    .pagination {
        flex-direction: row;
        justify-content: center !important;
    }

    .container {
        padding: 0 5px;
        margin-top: 0;
    }

    .nav-button {
        font-size: 0.8rem;
        margin: 0 2px;
    }

    .navbar {
        border-radius: 15px;
    }

    .title {
        font-size: 1.2rem;
    }

    .description {
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .container,.profile-main {
        margin-left: 10px !important;
        margin-right: 10px !important;
        width: calc(100% - 20px) !important;
        padding: 0!important;
    }
    
    /* .nav-container.nav-flex {
        margin-left: 10px;
        margin-right: 10px;
        width: calc(100% - 20px);
    } */
}

@media (max-width: 768px) {
    
    .character-header .character-title{
        /* padding-top: 40px; */
        font-size: 0.95rem;
        width: 75%;
        flex: unset;
    }

}

/* --- Begin nav.css styles merged --- */

.nav-container.nav-flex {
    max-width: 400px;  /* Fixed mobile width for all devices */
    width: 100%;
    margin: 0px auto 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-radius: 40px;
    min-height: 55px;
}

.nav-left {
    display: flex;
    width: 100%;
}

.nav-left {
    gap: 0;
}

@media (max-width: 900px) {
    .container{
        margin-top: 0;
    }
    .nav-container.nav-flex {
        padding: 8px 10px;
    }
    .nav-left{
        /* gap: 10px; */
    }
    #logoutForm{
        top: 10px !important;
    }
} 
/* --- End nav.css styles merged --- */

.character-number-label {
    font-weight: bold;
    color: #888;
    font-size: 0.75em;
    text-align: left;
}

.plus-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 2.5em;
    color: #bbb;
    margin-bottom: 2px;
    transition: color 0.2s;
}

.add-character-label {
    color: #bbb;
    font-size: 1em;
    margin-bottom: 8px;
}

.add-character-form {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.add-character-form.active {
    display: flex;
}

.add-character-title input {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #eee;
    font-size: 0.75em;
}

.add-character-desc textarea {
    width: 100%;
    /* height: 60px; */
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #eee;
    font-size: 1em;
    resize: vertical;
}

.moderation-icon {
    padding: 0px;
    font-size: 0.95rem;
}

.character-card {
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.empty-slot-container{
    width: 100%;
    height: 100%;
}

.plus-btn-full {
    background: transparent;
    border: none;
    color: #7dcf95;
    cursor: pointer;
    padding-right: 0;
    padding-left: 0;
}
.plus-btn-full .empty-icon {
    font-size: 2rem;
    display: block;
    font-weight: bold;
    margin-bottom: 3px;
    line-height: 0;
}
.add-character-form {
    display: block;
    width: 100%;
    height: 100%;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
    background: #f7f7f7;
    /* border: 2px solid #7dcf95; */
    border-radius: 14px;
    /* padding: 18px 16px 14px 16px; */
    animation: fadeIn 0.3s;
}
.add-character-title,.add-character-desc{
    width: 100%;
    margin-bottom: 8px;
}
.add-character-desc{
    height: 55%;
}
.add-character-desc textarea{
    height: 100%;
}
.add-character-form.active {
    display: flex;
}
.add-character-title input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1.5px solid lightgrey;
    font-size: 0.75em;
    background: #fff;
    transition: border-color 0.2s;
}
.add-character-title input:focus {
    /* border-color: #7dcf95; */
    outline: none;
}
.add-character-desc textarea {
    width: 100%;
    min-height: 140px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1.5px solid lightgrey;
    font-size: 0.75rem;
    background: #fff;
    resize: vertical;
    transition: border-color 0.2s;
}
.add-character-desc textarea:focus {
    /* border-color: #7dcf95; */
    outline: none;
}
.add-character-form .save-btn {
    background: #7dcf95;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}
.add-character-form.np__form .save-btn{
    float: right;
}
.edit-character-form.ep__form .save-btn{
    float: right;
}
.edit-character-form.ep__form .save-btn.pencil__icon{
    margin-right: 0;
}
.add-character-form.np__form .save-btn.pencil__icon{
    margin-right: 0;
    margin-top: 0;
}
.ep__form .editTitleCount{
    display: none !important;
}
/* Remove air character modal styles if present */
.air-character-modal, .air-character-modal * {
    display: none !important;
}

.character-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 8px;
}
.character-header.expanded{
    height: 100%;
}
.profile-page .character-header{
    margin-top: 20px;
}
.profile-page .character-header .character-meta{
    flex-flow: column;
    top: 10px;
    gap: 5px;
}   
.character-title {
    font-size: 1.4rem;
    color: #fff;
    margin: 0;
    font-weight: bold;
    flex: 1 1 auto;
    text-align: left;
}

.character-meta {
    padding-top: 0px;
    text-align: right;
    font-size: 1rem;
    color: rgba(255,255,255,0.8);
    min-width: 120px;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 2px;
}
.character-meta .meta-username {
    text-decoration: none;
    font-weight: bold;
    color: #fff;
    margin-bottom: 0px;
}

.edit-profile-btn, #editProfileBtn {
    /* background: #7dcf95; */
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    outline: none;
    /* letter-spacing: 0.5px; */
}

#editProfileBtn{
    margin-right: 3px;
}

/* Profile page buttons styling */
.profile-info-form.save-btn {
    background: none;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 0px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    float: right;
    margin-right: 8px;
    transition: all 0.3s ease;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.profile-info-form.save-btn.pencil__icon {
    margin-right: 0;
}

.profile-info-block .profile-info-form.save-btn {
    background: transparent;
    padding-top: 0;
    padding-left: 0;
    margin-right: 0;
    font-size: 0.85rem;
    padding-right: 0;
}
.profile-info-form.cancel-btn{
    margin-top: 10px;
    background: none;
    font-size: 1.25rem;
    border: none;
}
/* Cancel button styling */
.profile-info-form .save-btn[style*="background:#e57373"],
.profile-info-form .save-btn[style*="background: #e57373"] {
    background: #e57373 !important;
}

/* Responsive table wrapper */
.responsive-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

/* Responsive tables */
.profile-info-table, .players-table {
  /* min-width: 600px; */
  width: 100%;
}
.profile-info-table{
    /* padding-right: 15px; */
}

#profile-value-password .profile-edit-input{
    width: 49%;
}

@media (max-width: 700px) {
  .profile-info-table, .players-table {
    min-width: 0;
    width: 100%;
    font-size: 0.98rem;
  }
  .profile-info-table th, .profile-info-table td,
  .players-table th, .players-table td {
    padding: 8px 6px;
    font-size: 0.75rem;
  }
  .profile-info-block, .profile-characters-block, .players-container {
    padding: 10px 2vw;
    min-width: 0;
    box-sizing: border-box;
  }
  .character-card, .placeholder-card {
    min-width: 0;
    max-width: 100vw;
    box-sizing: border-box;
    font-size: 0.98rem;
  }
  .characters-grid {
    gap: 8px;
  }
  body, html {
    overflow-x: hidden !important;
  }
}

/* Hide horizontal overflow everywhere */
body, html {
  overflow-x: hidden;
}

/* Mobile nav menu */
@media (min-width: 701px) {
    #mobileNavMenu{
        display: none;
    }
}

@media (max-width: 500px) {
  .profile-info-table, .players-table {
    font-size: 0.92rem;
  }
  .character-card, .placeholder-card {
    font-size: 0.92rem;
  }
  
  .character-card .character-desc{
    font-size: 0.75rem;
  }
  .profile-page .character-card .character-desc{
    padding-right: 30px;
  }
  .characters-page .characters-grid .character-card{
    min-height: 350px;
    padding: 15px;
    height: auto;
    max-height: unset;
  }
  .profile-page .characters-grid .character-card{
    min-height: 375px;
    padding: 15px;
  }
  .character-content .moderation-status{
    font-size: 0.8rem;
  }
  .character-content .character-action-btn, .character-content .moderation-icon{
    font-size: 0.8rem;
  }
  .add-character-title input, .add-character-desc textarea{
    font-size: 16px;
  }
  .profile-info-block .profile-info-form.save-btn {
    font-size: 0.65rem;
  }
}

/* Hide scrollbars on mobile for wrappers */
.responsive-table-wrapper::-webkit-scrollbar {
  display: none;
}
.responsive-table-wrapper {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Hide main nav on mobile, only show mobile nav */
@media (max-width: 700px) {
  .profile-info-form.save-btn{
    font-size: 0.85rem;
  }
  form .logout-btn{
    font-size: 1.15rem;
    line-height: 15px;
  }
  #editProfileButtons{
    /* margin-right: 40px !important; */
  }
  #editProfileBtn{
    top: 8px;
    right: 50px;
    font-size: 0.70rem;
  }
  form .profile-edit-input{
    font-size: 0.75rem;
    padding: 5px;
    width: 99%;
  }
}

body.menu-open {
  overflow: hidden; /* Prevent scrolling of page when menu is open */
}
.edit-character-form {
    display: block;
    width: 100%;
    height: 85%;
}
.edit-title-input {
    padding: 8px;
    border: 1px solid lightgrey;
    border-radius: 8px;
}
.edit-desc-input {
    border: 1px solid lightgrey;
    border-radius: 8px;
    height: 75%;
    padding: 8px;
}

/* Mobile navigation - smaller text */
@media (max-width: 768px) {
    .nav-button {
        font-size: 13px !important;
        padding: 8px 12px !important;
    }
    
    .nav-left {
        gap: 0px !important;
    }
}

/* Email toggle button styling */
.toggle-email-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    margin-left: 8px;
    padding: 0px 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.obfuscated-email {
    letter-spacing: 1px;
    font-size: 0.75rem;
}

/* Pagination disabled state */
.pagination-btn[style*="pointer-events:none"] {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn {
    background: #8fd3ff;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 22px;
    font-size: 1.1rem;
    cursor: pointer;
    margin: 0 2px;
    transition: background 0.2s;
    text-decoration: none;
}
.pagination-btn:disabled {
    background: #e0e0e0;
    color: #aaa;
    cursor: not-allowed;
}

/* =============================================================================
   8-BIT CHARACTER ICONS
   ============================================================================= */

.character-icon-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    vertical-align: middle;
}

.character-icon-display svg {
    display: block;
}

/* Icon selector for character creation */
.icon-selector {
    margin-bottom: 16px;
}

.icon-selector-label {
    font-size: 0.75rem;
    color: #555;
    margin-bottom: 8px;
    font-weight: 500;
}

.icon-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.icon-option {
    cursor: pointer;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.icon-option:hover {
    border-color: #4a90e2;
    background: #f0f7ff;
}

.icon-option.selected,
.icon-option:has(input:checked) {
    border-color: #4a90e2;
    background: #e3f2fd;
}

.icon-option.selected .icon-svg,
.icon-option:has(input:checked) .icon-svg {
    color: #4a90e2;
}

.icon-svg {
    color: #666;
    transition: color 0.2s ease;
}

/* Character card with icon styling */
.character-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.character-title .character-icon-display {
    flex-shrink: 0;
}

/* Pending character icon color adjustment */
.character-card.pending .character-icon-display svg {
    fill: #333;
}

/* Ensure character title text wraps properly */
.character-title-view {
    display: flex;
    align-items: center;
    gap: 8px;
}