/* ==========================================================================
   Dune Wars - Command Centre (base page)
   Uses tokens from game.css. Loaded by app/Views/ingame/base.php.
   ========================================================================== */

.cc-wrap {
    padding-top: 22px; padding-bottom: 10px;
}

/* --------------------------------------------------------------------------
   Header / identity
   -------------------------------------------------------------------------- */
.cc-head {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    padding: 22px 24px;
    isolation: isolate;
    border: 1px solid var(--line-soft);
    background: linear-gradient(100deg, rgba(11, 8, 5, 0.96) 30%, rgba(11, 8, 5, 0.7)), url('/img/bosses/heighliner_wreck.webp') center 40% / cover;
}

.cc-head::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    width: 80px;
    height: 3px;
    background: var(--accent);
}

.cc-head__title {
    flex: 1 1 auto;
    min-width: 0;
}

.cc-eyebrow {
    font-weight: 700;
    font-size: 0.74rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent-hot);
}

.cc-head h1 {
    margin: 4px 0 6px;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: var(--text);
}

.cc-ident {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    color: var(--muted);
    font-weight: 600;
}

.cc-ident a { color: var(--dune-light); }
.cc-ident a:hover { color: var(--spice-hot); }
.cc-ident i { color: var(--faint); margin-right: 5px; }
.cc-ident .fa-crown { color: var(--spice-hot); }
.cc-ident .fa-heart { color: #ee5b9b; }

.cc-head__rank {
    text-align: right;
}

.cc-head__rank strong {
    display: block;
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1;
    color: var(--accent-hot);
}

.cc-head__rank span {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   Section titles
   -------------------------------------------------------------------------- */
.cc-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 26px 0 12px;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--dune-light);
}

.cc-section-title::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: linear-gradient(90deg, var(--line), transparent);
}

.cc-section-title small {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--faint);
}

/* --------------------------------------------------------------------------
   Protection banner
   -------------------------------------------------------------------------- */
.cc-ppt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding: 14px 18px;
    border-left: 3px solid var(--oasis);
    background: rgba(76, 217, 100, 0.08);
}

.cc-ppt i { font-size: 1.6rem; color: var(--oasis); }
.cc-ppt__text { flex: 1 1 auto; }
.cc-ppt__text strong { display: block; color: var(--text); font-size: 1.05rem; }
.cc-ppt__text span { color: var(--muted); }

/* --------------------------------------------------------------------------
   Orders (what to do next)
   -------------------------------------------------------------------------- */
.cc-orders {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.cc-order {
    --tone: var(--spice);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 128px;
    padding: 16px 16px 14px;
    background: linear-gradient(160deg, #1f160d, #120d08);
    border: 1px solid var(--line-soft);
    border-top: 3px solid var(--tone);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

a.cc-order:hover,
button.cc-order:hover {
    transform: translateY(-3px);
    border-color: var(--tone);
    color: var(--text);
    background: linear-gradient(160deg, #261b10, #140e08);
}

button.cc-order {
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.cc-order--blood { --tone: var(--blood-hot); }
.cc-order--ibad  { --tone: var(--ibad); }
.cc-order--oasis { --tone: var(--oasis); }
.cc-order--gold  { --tone: #e0a43a; }

.cc-order__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cc-order__icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: var(--sand-700);
    color: var(--tone);
    font-size: 1rem;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.cc-order__value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--tone);
    font-variant-numeric: tabular-nums;
}

.cc-order__label {
    font-weight: 700;
    font-size: 1.02rem;
    line-height: 1.2;
}

.cc-order__detail {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.3;
}

.cc-order__cta {
    margin-top: auto;
    padding-top: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--tone);
}

.cc-order__cta i { margin-left: 6px; transition: transform 0.15s ease; }
.cc-order:hover .cc-order__cta i { transform: translateX(4px); }

.cc-order__bar {
    height: 5px;
    background: var(--sand-700);
    overflow: hidden;
}

.cc-order__bar span {
    display: block;
    height: 100%;
    background: var(--tone);
}

.cc-order--quiet {
    --tone: var(--sand-500);
    grid-column: 1 / -1;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    gap: 14px;
}

/* --------------------------------------------------------------------------
   Resource tiles
   -------------------------------------------------------------------------- */
.cc-tiles {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.cc-tile {
    position: relative;
    padding: 14px 16px;
    background: linear-gradient(160deg, #1c140c, #120d08);
    border: 1px solid var(--line-soft);
    min-width: 0;
}

.cc-tile__label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.cc-tile__label i { color: var(--tile-color, var(--dune)); font-size: 0.9rem; }

/* leave room for the info button */
.cc-tile:has(.cc-info) .cc-tile__label { padding-right: 30px; }

.cc-tile__value {
    margin-top: 6px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    line-height: 1.15;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.cc-tile__sub {
    margin-top: 4px;
    font-size: 0.84rem;
    color: var(--faint);
}

.cc-info {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-soft);
    background: var(--sand-800);
    color: var(--muted) !important;
    font-size: 0.78rem;
    text-decoration: none;
}

.cc-info:hover { color: var(--text) !important; border-color: var(--accent); }

.cc-tile--spice  { --tile-color: var(--spice-hot); }
.cc-tile--income { --tile-color: var(--oasis); }
.cc-tile--water  { --tile-color: var(--ibad); }
.cc-tile--units  { --tile-color: #e0a43a; }
.cc-tile--turns  { --tile-color: var(--blood-hot); }
.cc-tile--covert { --tile-color: #a78bd6; }

/* --------------------------------------------------------------------------
   Two-column panels
   -------------------------------------------------------------------------- */
.cc-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.cc-grid--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

.cc-panel {
    position: relative;
    background: linear-gradient(160deg, #1c140c, #120d08);
    border: 1px solid var(--line-soft);
}

.cc-panel::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    width: 40px;
    height: 2px;
    background: var(--accent);
}

.cc-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-soft);
}

.cc-panel__head h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--dune-light);
}

.cc-panel__body { padding: 16px 18px; }

/* Military power rows */
.cc-power {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
}

.cc-power:last-child { border-bottom: 0; }

.cc-power__icon {
    grid-row: span 2;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    background: var(--sand-700);
    color: var(--power-color, var(--dune));
}

.cc-power__name {
    font-weight: 700;
    font-size: 0.95rem;
}

.cc-power__name a.cc-power-info {
    margin-left: 8px;
    font-size: 0.8rem;
    color: var(--faint) !important;
}

.cc-power__name a.cc-power-info:hover { color: var(--text) !important; }

.cc-power__value {
    text-align: right;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
}

.cc-power__bar {
    height: 6px;
    background: var(--sand-700);
    overflow: hidden;
}

.cc-power__bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--power-edge, var(--spice-edge)), var(--power-color, var(--spice)));
}

.cc-power__rank {
    text-align: right;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
}

.cc-power--strike  { --power-color: var(--blood-hot); --power-edge: var(--blood-edge); }
.cc-power--defense { --power-color: var(--ibad); --power-edge: var(--ibad-edge); }
.cc-power--covert  { --power-color: #a78bd6; --power-edge: #4d3a78; }
.cc-power--anti    { --power-color: var(--oasis); --power-edge: #1d6b2c; }
.cc-power--ms      { --power-color: var(--spice-hot); --power-edge: var(--spice-edge); }

.cc-power-total {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.cc-power-total > div {
    flex: 1 1 140px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line-soft);
}

.cc-power-total small {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.cc-power-total strong {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--text);
}

/* Profile list */
.cc-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cc-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line-soft);
}

.cc-list li:last-child { border-bottom: 0; }

.cc-list li > span:first-child {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.cc-list li > span:last-child {
    text-align: right;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cc-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.cc-form-row > .cc-form-grow { flex: 1 1 180px; }

.cc-hint {
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--faint);
}

.cc-note {
    margin: 14px 0;
    padding: 10px 14px;
    border-left: 3px solid var(--ibad);
    background: rgba(63, 169, 255, 0.07);
    font-size: 0.86rem;
    color: var(--muted);
}

.cc-note strong { color: var(--dune-light); }

.cc-flight {
    margin: 12px 0;
    padding: 12px 14px;
    border-left: 3px solid var(--spice);
    background: rgba(232, 134, 42, 0.08);
}

.cc-flight h4 { margin: 0 0 4px; font-size: 1rem; color: var(--text); }
.cc-flight p { margin: 0 0 8px; color: var(--muted); }

/* Recruiting + preferences */
.cc-share {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.cc-prefs a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line-soft);
    color: var(--text) !important;
    font-weight: 600;
}

.cc-prefs a:last-child { border-bottom: 0; }
.cc-prefs a i { width: 20px; color: var(--accent-hot); }
.cc-prefs a:hover { color: var(--spice-hot) !important; }

/* Breakdown modal rows (moved from the old page) */
.income-breakdown li,
.unit-production-breakdown li,
.attack-breakdown li,
.defense-breakdown li,
.covert-breakdown li,
.anticovert-breakdown li,
#waterBreakdownModal .list-unstyled li,
#msTotalBreakdownModal .list-unstyled li {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 5px;
}

.attack-breakdown li.mb-2,
.defense-breakdown li.mb-2 { display: block; }

.gs-body .modal .text-success { color: var(--oasis) !important; }
.gs-body .modal .text-danger { color: #ff7a6b !important; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1399.98px) {
    .cc-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1099.98px) {
    .cc-grid,
    .cc-grid--even { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767.98px) {
    .cc-wrap { padding-top: 14px; }
    .cc-head { padding: 16px; }
    .cc-head__rank { text-align: left; }

    /* Orders scroll sideways as a strip on phones */
    .cc-orders {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 6px;
        margin: 0 -12px;
        padding-left: 12px;
        padding-right: 12px;
        scrollbar-width: thin;
    }

    .cc-order {
        flex: 0 0 72%;
        scroll-snap-align: start;
    }

    .cc-order--quiet { flex-basis: 100%; }

    .cc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .cc-tile { padding: 12px; }
    .cc-tile__value { font-size: 1.15rem; }
}
