/* General Layout Setup */
body {
    background: #0d0f12;
    color: #e5e7eb;
}

html,
body,
canvas {
    margin: 0;
    border: 0;
    padding: 0;
    display: block;
    overflow: hidden;
    height: 100%;
}

#view,
#ui {
    position: absolute;
    width: 100%;
    height: 100%;
}

#view {
    z-index: 1;
}

#ui {
    z-index: 4;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: radial-gradient(circle at center, rgba(17, 24, 39, 0.75) 0%, rgba(8, 10, 15, 0.92) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

#ui.hide {
    display: none;
}

/* Global Typography */
body,
button,
input,
textarea {
    font-family: 'Inter', 'PT Sans Caption', sans-serif;
    color: #f3f4f6;
}

input, textarea {
    width: 100%;
    display: block;
}

/* Nickname Input */
#nick {
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 18px;
    color: #ffffff;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
    width: 100%;
    box-sizing: border-box;
    text-indent: 0;
    font-weight: 500;
}

#nick:focus {
    border-color: #ff6b2c;
    box-shadow: 0 0 18px rgba(255, 107, 44, 0.35), inset 0 2px 4px rgba(0, 0, 0, 0.4);
    background: rgba(15, 23, 42, 0.8);
}

#nick::placeholder {
    color: #6b7280;
    opacity: 1;
}

/* Premium Card Container */
.uibox {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    max-width: 500px;
    margin: 40px auto 0 auto;
    padding: 35px 28px;
    order: 2;
    width: 100%;
    min-width: 350px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.uibox .logo {
    text-align: center;
    height: 115px;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.logo img {
    width: 380px;
    filter: drop-shadow(0 0 8px rgba(255, 107, 44, 0.35));
}

#left_side {
    order: 1;
}

#right_side {
    order: 3;
}

#left_side,
#right_side {
    width: 260px;
}

/* Navigation Layout */
.nav {
    margin: 15px 10%;
    display: flex;
    justify-content: center;
}

.uibox .play {
    margin: 0 10%;
    display: flex;
    justify-content: center;
}

.uibox .tips {
    height: 60px;
    display: flex;
}

.uibox .tip {
    color: #9ca3af;
    text-align: center;
    font-size: 15px;
    animation: fadein 2s;
    padding: 10px 10%;
    align-self: flex-end;
    width: 100%;
}

/* Custom Buttons */
button {
    border: none;
    border-radius: 12px;
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 12px 24px;
    margin: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:focus {
    outline: none;
}

button.yellow {
    background: linear-gradient(135deg, #f17d35 0%, #e05e1b 100%);
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 30px;
    letter-spacing: 2px;
    padding: 15px 30px;
    box-shadow: 0 4px 20px rgba(241, 125, 53, 0.35);
}

button.yellow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(241, 125, 53, 0.55);
    background: linear-gradient(135deg, #ff9250 0%, #f17d35 100%);
}

button.yellow:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(241, 125, 53, 0.3);
}

button.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 22px;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

button.green:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

button.green:active {
    transform: translateY(1px);
}

button.orange {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 22px;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

button.orange:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.45);
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

button.unavail {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.35);
    cursor: not-allowed;
    box-shadow: none;
}

button.disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    cursor: default;
    box-shadow: none;
}

/* Experience Bar Styling */
#expaBar {
    margin: 15px 10%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#fullExpBar {
    height: 100%;
    background: linear-gradient(90deg, #f17d35 0%, #fcd34d 100%);
    box-shadow: 0 0 10px rgba(241, 125, 53, 0.4);
}

#emptyExpBar {
    display: none;
}

.lvlInfoText {
    text-align: center;
    font-size: 16px;
    color: #9ca3af;
    margin: 10px;
    font-weight: 500;
}

/* About Screen ( spaceship data-pad style ) */
#about {
    display: none;
    z-index: 10;
    position: absolute;
    box-sizing: border-box;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 600px;
    height: 80%;
    overflow-y: auto;
    padding: 32px;
    border-radius: 20px;
    background: rgba(13, 16, 21, 0.96);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(241, 125, 53, 0.1);
    backdrop-filter: blur(20px);
}

#about h1 {
    color: #f17d35;
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

#about h2 {
    color: #f3f4f6;
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    margin-top: 24px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#about p, #about ul {
    color: #9ca3af;
    font-size: 15px;
    line-height: 1.6;
}

#about li {
    margin-bottom: 8px;
}

.close-about-btn {
    display: inline-block;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #ffffff !important;
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.close-about-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* Leaderboard Sidebar */
.leaderboard {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px 16px;
    margin: 15px;
    color: #e5e7eb;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
}

.leaderboard h3 {
    color: #f17d35;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    margin: 0 0 15px 0;
    text-shadow: 0 0 8px rgba(241, 125, 53, 0.3);
}

.leaderboard ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
}

.leaderboard li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    margin-bottom: 4px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.leaderboard li:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.leaderboard li .lb_item_left {
    display: flex;
    align-items: center;
}

.leaderboard li .title {
    color: #9ca3af;
    padding: 0 10px 0 5px;
    font-size: 14px;
}

.leaderboard li .player {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
}

.leaderboard li .top {
    min-width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    margin-right: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #000000;
    display: inline-block;
}

.leaderboard li .top1 {
    background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.leaderboard li .top2 {
    background: linear-gradient(135deg, #e5e7eb 0%, #9ca3af 100%);
    box-shadow: 0 0 8px rgba(156, 163, 175, 0.4);
}

.leaderboard li .top3 {
    background: linear-gradient(135deg, #ca8a04 0%, #854d0e 100%);
    box-shadow: 0 0 8px rgba(133, 77, 14, 0.4);
}

.leaderboard li .empty {
    min-width: 24px;
    height: 24px;
    line-height: 24px;
    margin-right: 8px;
    display: inline-block;
}

.leaderboard li.extra_margin {
    margin-top: 18px;
}

/* Results Window */
.resultsimg {
    width: 50%;
    margin: auto;
}

.resultsimg img {
    width: 100%;
}

.results {
    display: flex;
    justify-content: center;
    font-size: 18px;
    text-shadow: 0px 0px 4px rgba(0,0,0,0.5);
    white-space: nowrap;
    color: #ffffff;
}

.results .left {
    text-align: right;
    margin-right: 10px;
    color: #9ca3af;
}

.newScore {
    color: #10b981;
    font-weight: bold;
}

#resultsPopUp {
    position: absolute;
    display: none;
    justify-content: center;
    width: 100%;
    top: 140px;
    height: fit-content;
    z-index: 10;
}

.popUpBack {
    background-color: rgba(17, 24, 39, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    border-radius: 16px;
    max-width: 600px;
    width: 600px;
    justify-content: center;
    display: flex;
    padding: 20px;
}

.popUp .skin {
    justify-content: center !important;
    width: inherit;
    max-width: 300px;
}

.namePopUp {
    text-align: center;
    font-size: 22px;
    color: #fcd34d;
    margin-top: 20px;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
}

/* Skin Picker Grid */
.skins-container {
    display: flex;
    flex-direction: row;
    flex: 1;
    align-items: center;
    justify-content: center;
    user-select: none;
    height: 250px;
}

.skin {
    margin: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    padding: 12px;
    background: rgba(30, 41, 59, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    width: 100%;
    user-select: none;
    max-width: 200px;
    height: 220px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.25s ease;
}

.skin:hover {
    transform: translateY(-4px);
    border-color: rgba(241, 125, 53, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 10px rgba(241, 125, 53, 0.1);
}

.skin-view {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    flex-grow: 1;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.skin-view img {
    max-width: 70px;
    max-height: 70px;
    display: block;
    margin: 0 auto;
}

.skin-view h3 {
    font-family: 'Orbitron', sans-serif;
    margin: 10px 0 0 0;
    color: #ffffff;
    font-size: 16px;
    text-transform: uppercase;
    font-weight: 700;
}

.skin-descr {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 6px;
    margin-top: 10px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.partSkinInfo {
    width: 50%;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    padding: 4px;
    border-radius: 6px;
}

.partSkinInfo.good {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.partSkinInfo.bad {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.detailsSkinInfo {
    display: flex;
    flex: auto;
    gap: 5px;
    margin-top: 10px;
}

.imgIconSkin {
    height: 35px;
}

.skinIcon {
    height: 35px;
    position: relative;
    bottom: 10px;
    left: 10px;
    margin: 0px !important;
}

.skin-nav {
    margin-top: 5px;
}

#leftSideUI {
    position: absolute;
    left: 0px;
    top: 0px;
    padding: 20px;
    z-index: 6;
}

/* Social Share UI */
#socialBtns {
    margin-bottom: 8px;
    display: flex;
    gap: 8px;
}

#socialBtns img {
    width: 90px;
    border-radius: 6px;
    transition: transform 0.2s;
}

#socialBtns img:hover {
    transform: scale(1.05);
}

a.shareBtn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: inline-block;
    cursor: pointer;
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 10px 20px;
    text-decoration: none;
    margin-bottom: 12px;
    border-radius: 10px;
    transition: all 0.2s;
    text-align: center;
}

a.shareBtn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

#shareInvite {
    z-index: 99;
    position: fixed;
    box-sizing: border-box;
    left: 20px;
    top: 20px;
    width: 290px;
    background-color: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 15px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
}

#shareInvite p {
    margin: 5px 0 12px 0;
    font-size: 14px;
    color: #9ca3af;
}

.shareInvite-text {
    text-align: center;
}

.inviteTitle {
    font-weight: 700;
    font-size: 20px;
    display: block;
    padding-bottom: 6px;
    font-family: 'Orbitron', sans-serif;
    color: #f17d35;
}

#shareLinkInput {
    width: 100%;
    height: 36px;
    font-size: 14px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: #ffffff;
    border-radius: 8px;
    padding: 0 8px;
    box-sizing: border-box;
    text-align: center;
}

#shareInvite button {
    font-size: 18px;
    background: linear-gradient(135deg, #f17d35 0%, #e05e1b 100%);
    border: none;
    color: white;
    padding: 8px 20px;
    margin-top: 12px;
    border-radius: 8px;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
}

#shareInvite button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(241, 125, 53, 0.3);
}

#shareInvite a {
    color: #9ca3af;
    display: block;
    font-size: 13px;
    text-decoration: underline;
    margin-top: 12px;
}

#shareInvite a:hover {
    color: #ffffff;
}

/* Footer Links */
#bottom {
    position: absolute;
    text-align: center;
    bottom: 0px;
    right: 0px;
    color: #9ca3af;
    z-index: 5;
    background-color: rgba(17, 24, 39, 0.85);
    border-top-left-radius: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    backdrop-filter: blur(5px);
}

#bottom a {
    color: #e5e7eb;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

#bottom a:hover {
    color: #f17d35;
}

/* Animations */
@keyframes kf_slider {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slider-1 { animation: kf_slider 0.8s 0s both ease-out; }
.slider-2 { animation: kf_slider 0.8s 0.15s both ease-out; }
.slider-3 { animation: kf_slider 0.8s 0.3s both ease-out; }
.slider-4 { animation: kf_slider 0.8s 0.45s both ease-out; }
.slider-5 { animation: kf_slider 0.8s 0.6s both ease-out; }

/* Disabled Ads Containers */
#adsBanner, #rightbanner, #aipBranding {
    display: none !important;
}
