* {
    box-sizing: border-box;
}

body {
    background: #0f172a;
    color: #f8fafc;
    font-family: "Segoe UI", Arial, sans-serif;
    margin: 0;
}

a {
    color: inherit;
}

.main-header {
    background: #111827;
    border-bottom: 1px solid #334155;
    padding: 18px 25px;
}

.header-content {
    max-width: 1200px;
    margin: auto;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 12px;
}

.user-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.info-box {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 12px;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 25px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 18px;
    padding: 18px;
    transition: 0.25s;
}

.card:hover {
    transform: translateY(-4px);
    border-color: #38bdf8;
    box-shadow: 0 0 22px rgba(56, 189, 248, 0.25);
}

.title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat {
    margin: 6px 0;
}

.btn {
    display: inline-block;
    background: #2563eb;
    color: white;
    text-decoration: none;
    border: none;
    padding: 10px 15px;
    border-radius: 12px;
    cursor: pointer;
    margin: 4px 0;
}

.btn:hover {
    background: #1d4ed8;
}

.ready {
    color: #22c55e;
    font-weight: bold;
}

.cooldown {
    color: #f97316;
    font-weight: bold;
}

.main-footer {
    text-align: center;
    color: #94a3b8;
    padding: 25px;
    border-top: 1px solid #334155;
    margin-top: 30px;
}

input,
select {
    width: 100%;
    max-width: 420px;
    background: #0f172a;
    color: white;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 10px;
}

input:focus,
select:focus {
    outline: none;
    border-color: #38bdf8;
}
.regions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 22px;
}

.region-card {
    position: relative;
    overflow: hidden;
}

.planet {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 15px auto;
    background: radial-gradient(circle at 30% 30%, #67e8f9, #2563eb, #111827);
    box-shadow: 0 0 35px rgba(56, 189, 248, 0.45);
}

.region-card:nth-child(even) .planet {
    background: radial-gradient(circle at 30% 30%, #c084fc, #7c3aed, #111827);
    box-shadow: 0 0 35px rgba(168, 85, 247, 0.45);
}

.region-card:nth-child(3n) .planet {
    background: radial-gradient(circle at 30% 30%, #facc15, #f97316, #111827);
    box-shadow: 0 0 35px rgba(251, 146, 60, 0.45);
}

.region-card form {
    margin-top: 12px;
}
.preview-box {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 12px;
    max-width: 420px;
}


.planet-timeline {
    position: relative;
    margin-top: 40px;
}

.planet-timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: #111827;
    transform: translateX(-50%);
}

.planet-row {
    position: relative;
    display: flex;
    margin: 70px 0;
}

.planet-row.left {
    justify-content: flex-start;
}

.planet-row.right {
    justify-content: flex-end;
}

.planet-node {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #6366f1;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(99,102,241,.7);
    z-index: 2;
}

.planet-card {
    width: 38%;
    text-align: center;
    background: #161b29;
    border-radius: 6px;
    padding: 22px;
    border: 1px solid #222b3d;
}

.planet-img {
    width: 100%;
    height: 180px;
    background: radial-gradient(circle at center, #9333ea 0%, #581c87 30%, #020617 70%);
    border-radius: 4px;
    margin: 15px 0;
    box-shadow: inset 0 0 40px rgba(255,255,255,.08);
}

.planet-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 10px;
}

.mine-planet-btn {
    background: #ef4444;
    border-radius: 999px;
    padding: 12px 26px;
}

.mine-planet-btn:hover {
    background: #dc2626;
}

.mine-planet-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

@media(max-width: 800px) {
    .planet-timeline::before {
        left: 20px;
    }

    .planet-node {
        left: 20px;
    }

    .planet-row,
    .planet-row.left,
    .planet-row.right {
        justify-content: flex-end;
    }

    .planet-card {
        width: calc(100% - 55px);
    }
}

.select-card {
    display: block;
    cursor: pointer;
}

.hidden-check {
    display: none;
}

.hidden-check:checked + .card {
    border-color: #38bdf8;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.45);
    transform: translateY(-4px);
}

.ship-image,
.general-image {
    height: 160px;
    background: radial-gradient(circle at center, #334155, #020617);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    margin: 12px 0;
}

.general-card {
    min-height: 310px;
}

.ship-card {
    min-height: 290px;
}

.fleet-cooldown-option {
    color: #f87171;
}

.planet-chance{
    color:#38bdf8;
    font-size:20px;
    font-weight:bold;
}

.result-modal {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.result-box {
    background: #111827;
    border: 1px solid #334155;
    border-radius: 22px;
    padding: 35px;
    width: 360px;
    text-align: center;
    box-shadow: 0 0 35px rgba(56, 189, 248, 0.35);
}

.result-icon {
    font-size: 75px;
    margin-bottom: 15px;
}

.result-success {
    color: #22c55e;
}

.result-failed {
    color: #ef4444;
}

.loader {
    width: 60px;
    height: 60px;
    border: 6px solid #334155;
    border-top-color: #38bdf8;
    border-radius: 50%;
    margin: 20px auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}



.nav-item:hover{
    transform:translateY(-3px);
    border-color:#38bdf8;
}

.dashboard-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
    gap:20px;
}

.hero-action{
    display:block;
    text-align:center;
    font-size:24px;
    padding:25px;
    margin-top:25px;
}

.success-stat{
    color:#22c55e;
}

.failed-stat{
    color:#ef4444;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.logo-link {
    font-size: 30px;
    font-weight: bold;
    text-decoration: none;
    color: white;
}

.logo-link:hover {
    color: #38bdf8;
}

.logout-link {
    background: #7f1d1d;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: white;
}

.logout-link:hover {
    background: #991b1b;
}

.main-nav {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.main-nav a {
    background: #0f172a;
    border: 1px solid #334155;
    padding: 10px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: white;
    transition: 0.25s;
}

.main-nav a:hover {
    border-color: #38bdf8;
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
}

.grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:20px;
}

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

.pagination a{
    min-width:40px;
    text-align:center;
    padding:10px;
    border-radius:10px;
    text-decoration:none;
    background:#111827;
    color:white;
    border:1px solid #334155;
}

.pagination a:hover{
    border-color:#38bdf8;
}

.active-page{
    background:#38bdf8 !important;
    color:black !important;
    font-weight:bold;
}

.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}

.mint-result-card {
    border-color: #38bdf8;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.35);
}



.card:hover .general-image img,
.card:hover .ship-image img{
    transform:scale(1.05);
}

.pack-card {
    width: 320px;
    margin: 15px auto;
    background: linear-gradient(180deg,#111827,#020617);
    border: 2px solid #38bdf8;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 0 35px rgba(56,189,248,.45);
}
.pack-card img{
    width:100%;
    height:180px;
    object-fit:contain;
}

.result-box{
    width:380px;
    max-width:90vw;
}

.nft-grid {
    display: grid;
    grid-template-columns: repeat(4, 270px);
    gap: 22px;
    justify-content: center;
}

.nft-card {
    width: 270px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 18px;
    padding: 16px;
    transition: .25s;
    cursor: pointer;
}

.nft-image {
    width: 100%;
    height: 180px;
    background: #08111f;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.nft-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: nftFloat 3s ease-in-out infinite;
}

.nft-card:hover {
    transform: translateY(-4px);
    border-color: #38bdf8;
    box-shadow: 0 0 22px rgba(56,189,248,.25);
}

.nft-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 12px;
}

.nft-image {
    width: 100%;
    height: 230px;
    background: #08111f;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.nft-image img {
    height: 100%;
    width: auto;
    object-fit: contain;
    animation: nftFloat 3s ease-in-out infinite;
}

.nft-stat {
    margin-top: 8px;
}

.select-card input {
    display: none;
}

.select-card input:checked + .nft-card {
    border-color: #38bdf8;
    box-shadow: 0 0 28px rgba(56,189,248,.55);
}

.create-summary {
    margin: 25px 0;
}

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

.pagination a {
    padding: 10px 14px;
    background: #111827;
    border: 1px solid #334155;
    border-radius: 10px;
    text-decoration: none;
    color: white;
}

.pagination a.active-page {
    background: #38bdf8;
    color: #020617;
    font-weight: bold;
}

@keyframes nftFloat {
    0% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
    100% { transform: translateY(0); }
}

.fleet-card .nft-image img {
    animation: nftFloat 3s ease-in-out infinite;
}

.planet-image {
    width: 100%;
    height: 260px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.planet-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.general-image img,
.ship-image img {
    animation: nftFloat 3s ease-in-out infinite;
}

.general-image,
.ship-image{
    width:100%;
    height:180px;
    background:#08111f;
    border-radius:14px;
    display:flex;
    justify-content:center;
    align-items:center;
    overflow:hidden;
}

.general-image img,
.ship-image img{
    width:100%;
    height:100%;
    object-fit:cover;
    animation:nftFloat 3s ease-in-out infinite;
}

.exp-box {
    margin-top: 10px;
}

.exp-label {
    font-size: 14px;
    margin-bottom: 6px;
}

.exp-bar {
    width: 100%;
    height: 12px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 999px;
    overflow: hidden;
}

.exp-fill {
    height: 100%;
    background: #38bdf8;
    border-radius: 999px;
}

.market-listed-card{
    opacity:.65;
    filter:grayscale(80%);
    border:2px solid #666;
}

.market-listed-card .title{
    color:#ccc;
}

.planet-card {
    overflow: hidden;
}

.planet-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    align-items: start;
    text-align: center;
}

.planet-stats > div {
    min-width: 0;
}

.planet-stats small {
    display: block;
    font-size: 12px;
    line-height: 1.2;
    white-space: normal;
}

.planet-stats strong {
    display: block;
    font-size: 16px;
    line-height: 1.35;
}

.planet-success-rate span {
    display: inline-block;
}



/* Production layout fix: planets are shown as a clean responsive grid, not a broken zig-zag timeline. */
.planet-timeline {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)) !important;
    gap: 28px !important;
    margin-top: 30px !important;
    align-items: start !important;
}

.planet-timeline::before {
    display: none !important;
}

.planet-row,
.planet-row.left,
.planet-row.right {
    display: block !important;
    margin: 0 !important;
    justify-content: initial !important;
    position: relative !important;
}

.planet-node {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    margin: 0 auto -16px auto !important;
    width: 42px !important;
    height: 42px !important;
    z-index: 3 !important;
}

.planet-card {
    width: 100% !important;
    max-width: 430px !important;
    min-height: 520px !important;
    margin: 0 auto !important;
    text-align: center !important;
    border-radius: 8px !important;
}

.planet-image {
    height: 260px !important;
    margin: 10px 0 !important;
}

.planet-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

.planet-stats {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px !important;
    align-items: start !important;
    text-align: center !important;
}

.planet-stats strong {
    font-size: 16px !important;
    line-height: 1.35 !important;
}

@media (max-width: 800px) {
    .planet-timeline {
        grid-template-columns: 1fr !important;
    }

    .planet-card {
        width: 100% !important;
        max-width: 430px !important;
    }

    .planet-node {
        left: auto !important;
    }
}


