/* rapido.css — Rapido Brand Portal Specifics */

/* Sort Buttons — Rapido red */
.rapido-body .cl-sort-btn {
  border-color: var(--color-rapido-red, #e31e24);
  color: var(--color-rapido-red, #e31e24);
  box-shadow: 3px 3px 0px var(--color-rapido-red, #e31e24);
}
.rapido-body .cl-sort-btn:hover:not(.active) {
  background: rgba(227,30,36,0.06);
}
.rapido-body .cl-sort-btn.active {
  background: var(--color-rapido-red, #e31e24);
  color: #fff;
  box-shadow: none;
}

:root {
    --rapido-yellow: #FFF200;
    --rapido-black: #000000;
    --tarmac-grey: #1a1a1a;
}

.rapido-body {
  --amalgam-bg: var(--rapido-yellow);
}

body.rapido-body {
  background-color: var(--rapido-yellow);
  background-image: 
    linear-gradient(#000 1px, transparent 1px),
    linear-gradient(90deg, #000 1px, transparent 1px);
  background-size: 30px 30px;
}

#rapido-portal {
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
    z-index: 1;
}

/* Ensure all actual content stays visible */
#rapido-portal main {
    position: relative;
    z-index: 10;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    body.rapido-body { background-size: 25px 25px; }
}

.rapido-badge { 
  background: #000;
  color: #fff;
  border: 3px solid var(--rapido-yellow);
  padding: 5px 20px;
  font-weight: 900;
  text-transform: uppercase;
  transform: skewX(-15deg);
  display: inline-block;
}

.cl-ph-stat {
  display: flex;
  flex-direction: column;
}

/* Hard Brutalism Overhaul */
.rapido-hero .cl-portal-hero-inner {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 3rem 2rem; /* Reduced from 6rem */
    max-width: 1400px;
    margin: 0 auto;
    box-shadow: none;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem; /* Reduced from 4rem */
    align-items: center;
    text-align: left;
}

/* Hero Typography Enhancements */
.rapido-hero .cl-portal-name {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2.5rem, 12vw, 10rem); /* Shrunk from 6rem/15vw/14rem */
    font-weight: 900;
    line-height: 0.8; /* Tighter line height */
    text-transform: uppercase;
    margin: 0 0 1rem -5px;
    color: #000;
    letter-spacing: -5px; /* Slightly relaxed for readability at smaller size */
    text-shadow: 6px 6px 0px #fff;
    position: relative;
    z-index: 2;
}

.rapido-hero .cl-portal-subline {
    font-family: 'Space Mono', monospace;
    font-size: 1.1rem; /* Shrunk from 1.3rem */
    font-weight: 700;
    text-transform: uppercase;
    background: #000;
    color: var(--rapido-yellow);
    display: inline-block;
    padding: 0.4rem 0.8rem;
    box-shadow: 4px 4px 0px #fff;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.rapido-hero .cl-portal-logo-wrap {
    margin-bottom: -1rem;
    position: relative;
    z-index: 3;
}
.rapido-hero .cl-portal-logo-wrap img {
    height: 60px; /* Shrunk from 80px */
    filter: drop-shadow(4px 4px 0px #fff);
}

.cl-portal-hero-stats-panel {
    background: #000;
    border: 4px solid var(--rapido-yellow);
    padding: 1.5rem; /* Shrunk from 2.5rem */
    box-shadow: 10px 10px 0px #000;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cl-ph-stat {
    display: flex;
    flex-direction: column;
}

.cl-ph-stat span {
    color: var(--rapido-yellow) !important;
    font-family: 'Space Mono', monospace;
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
}

.cl-ph-stat label {
    color: #fff !important;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 1 !important;
}

@media (max-width: 992px) {
    .rapido-hero .cl-portal-hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 4rem 1.5rem;
    }
    .cl-portal-hero-stats-panel {
        flex-direction: row;
        justify-content: space-around;
        padding: 1.5rem;
    }
}

/* Feed Controls Layout */
.cl-feed-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto 3rem auto;
    padding: 0 2rem;
}

@media (max-width: 992px) {
    .cl-feed-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
}

/* Grid Layout for Feed */
#rapido-feed.cl-feed-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 992px) {
    #rapido-feed.cl-feed-grid {
        grid-template-columns: 1fr;
    }
}

/* Card Refinement */
.cl-story-card.rapido-card {
    border-radius: 0;
    border: 5px solid #000;
    background: #111;
    color: #fff;
    box-shadow: 15px 15px 0px #000;
    transition: all 0.2s ease-out;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 450px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transform: none; /* Removed skew for standard grid feel */
}

/* Intriguing Hover Effect - Background fill & Stamp */
.cl-story-card.rapido-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--rapido-yellow);
    z-index: -1;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s cubic-bezier(0.8, 0, 0.2, 1);
}

.cl-story-card.rapido-card::after {
    content: 'INCIDENT';
    position: absolute;
    top: -20px;
    right: -20px;
    font-family: 'Syne', sans-serif;
    font-size: 6rem;
    font-weight: 900;
    color: rgba(0,0,0,0.03);
    transform: rotate(10deg);
    pointer-events: none;
    z-index: 0;
    transition: color 0.3s;
}

.cl-story-card.rapido-card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 19px 19px 0px #000;
    color: #000;
}

.cl-story-card.rapido-card:hover::before {
    transform: scaleY(1);
    transform-origin: top;
}

.cl-story-card.rapido-card:hover::after {
    color: rgba(0,0,0,0.08);
}

.cl-story-card.rapido-card:hover .cl-story-location,
.cl-story-card.rapido-card:hover .cl-story-category,
.cl-story-card.rapido-card:hover .cl-story-title,
.cl-story-card.rapido-card:hover .cl-story-excerpt,
.cl-story-card.rapido-card:hover .cl-story-body,
.cl-story-card.rapido-card:hover .cl-upvote-btn,
.cl-story-card.rapido-card:hover .cl-share-row,
.cl-story-card.rapido-card:hover .cl-read-more {
    color: #000 !important;
}

/* Ensure text stays above background effects */
.cl-story-card.rapido-card .cl-story-header,
.cl-story-card.rapido-card .cl-story-title,
.cl-story-card.rapido-card .cl-story-excerpt,
.cl-story-card.rapido-card .cl-story-body,
.cl-story-card.rapido-card .cl-story-footer {
    position: relative;
    z-index: 2;
}

.cl-story-card.rapido-card .cl-story-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--rapido-yellow);
    text-transform: uppercase;
}

.cl-story-card.rapido-card .cl-story-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.3;
    margin: 0;
    color: #fff;
}

.cl-story-card.rapido-card .cl-story-excerpt,
.cl-story-card.rapido-card .cl-story-body {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #ccc;
    margin: 0;
}

.cl-story-card.rapido-card .cl-story-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
}

.cl-story-card.rapido-card .cl-footer-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cl-story-card.rapido-card .cl-upvote-btn {
    background: transparent;
    border: none;
    font-family: 'Space Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    color: #fff;
}

.cl-story-card.rapido-card .cl-share-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: #888;
}

.cl-story-card.rapido-card .cl-share-btn {
    color: var(--rapido-yellow);
    display: flex;
    align-items: center;
}

.cl-story-card.rapido-card .cl-read-btn,
.cl-story-card.rapido-card .cl-read-more {
    background: transparent;
    border: none;
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    text-transform: uppercase;
}

/* Ticker Overlap Fix */
#rapido-portal {
    background-color: var(--rapido-yellow);
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    cursor: crosshair; 
    padding-bottom: 40px;
}

.rapido-ticker-wrap {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: #000;
    color: var(--rapido-yellow);
    padding: 5px 0;
    font-family: 'Space Mono', monospace;
    font-weight: 900;
    font-size: 12px;
    z-index: 9999;
    border-top: 3px solid #000;
}

.rapido-ticker {
    display: flex;
    white-space: nowrap;
    animation: rapido-ticker-scroll 20s linear infinite;
}

.rapido-ticker span {
    padding: 0 40px;
}

@keyframes rapido-ticker-scroll {
    from { transform: translateX(100%); }
    to { transform: translateX(-100%); }
}

.rapido-cta {
  background: #000;
  color: var(--rapido-yellow);
  border: 4px solid var(--rapido-yellow);
  box-shadow: 10px 10px 0px rgba(255,242,0,0.5);
  font-weight: 900;
  text-transform: uppercase;
}

.rapido-cta:hover {
  transform: translate(-5px, -5px);
  box-shadow: 15px 15px 0px rgba(255,242,0,0.8);
}

.rapido-chat-header { 
  background: #000;
  color: var(--rapido-yellow);
  border-bottom: 3px solid var(--rapido-yellow);
}

.rapido-modal h2 { color: var(--rapido-yellow); font-weight: 900; text-transform: uppercase; transform: skewX(-10deg); }

/* Modal Refinement */
.cl-modal.rapido-modal {
    border-radius: 0;
    border: 5px solid var(--rapido-yellow);
    box-shadow: 20px 20px 0px #000;
    background: #111;
    color: #fff;
    padding: 4rem;
}

.cl-modal-meta {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    color: #888;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.rapido-modal h2 {
    font-family: 'Syne', sans-serif;
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 2rem;
}

.cl-modal-body {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    line-height: 1.6;
    color: #ccc;
}

.rapido-modal .cl-modal-close {
    font-size: 2rem;
    font-weight: 900;
    color: var(--rapido-yellow);
    top: 2rem;
    right: 2rem;
}

/* Pro-Racer Slalom Game Styling */
.cl-game-section {
    background: #000; 
    color: var(--rapido-yellow);
}

.game-header-wrap {
    text-align: center;
    margin-bottom: 1.5rem;
    transform: skewX(-10deg);
}

.game-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--rapido-yellow);
    text-transform: uppercase;
    background: #000;
    display: inline-block;
    padding: 0 15px;
    border: 3px solid var(--rapido-yellow);
}

.game-subtitle {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: #000;
    background: var(--rapido-yellow);
    display: table;
    margin: 5px auto;
    padding: 3px 10px;
    font-weight: 700;
}

#rapido-slalom-game {
    background: var(--rapido-yellow); 
    border: 3px solid #000;
    height: 350px; 
    width: 100%;
    max-width: 450px; 
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    font-family: 'Space Mono', monospace;
    box-shadow: 10px 10px 0px #000;
    outline: 8px solid var(--rapido-yellow);
}

.race-stats {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #000;
    color: var(--rapido-yellow);
    font-weight: 900;
    font-size: 0.8rem;
    position: relative;
    z-index: 15;
}

#road-stage {
    position: absolute;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 40px,
        rgba(0,0,0,0.05) 40px,
        rgba(0,0,0,0.05) 80px
    );
}

#player-bike {
    position: absolute;
    bottom: 40px;
    left: 50%;
    font-size: 40px;
    transform: translateX(-50%);
    transition: left 0.15s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    z-index: 5;
    filter: drop-shadow(0 5px 0 rgba(0,0,0,0.2));
}

.obstacle {
    position: absolute;
    font-weight: 900;
    font-size: 10px;
    background: #000;
    color: var(--rapido-yellow);
    padding: 4px 8px;
    white-space: nowrap;
    border: 2px solid #000;
    z-index: 4;
    text-transform: uppercase;
}

.mobile-tap-zones {
    display: flex;
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.tap-zone {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    cursor: pointer;
}

#race-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 242, 0, 0.95);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

#crash-reason {
    color: #000;
    font-weight: 900;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

#helmet-warning {
    background: #000;
    color: var(--rapido-yellow);
    padding: 10px;
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 25;
    text-transform: uppercase;
    animation: flash-warning 0.2s infinite;
}

@keyframes flash-warning {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.game-hint-wrap {
    position: absolute;
    bottom: 10px;
    width: 100%;
    text-align: center;
    font-size: 0.6rem;
    font-weight: 700;
    opacity: 0.5;
    pointer-events: none;
}

.race-overlay-start {
    position: absolute;
    inset: 0;
    background: var(--rapido-yellow);
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.start-content h3 {
    font-size: 2rem;
    font-weight: 900;
    margin: 1rem 0;
}

.start-content p {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.glitch-icon {
    font-size: 4rem;
    animation: jitter-icon 0.2s infinite;
}

@keyframes jitter-icon {
    0% { transform: translate(0,0); }
    25% { transform: translate(-2px, 2px); }
    50% { transform: translate(2px, -2px); }
    75% { transform: translate(-2px, -2px); }
    100% { transform: translate(2px, 2px); }
}

/* Form container — exact OLA match */
.cl-form-container {
    max-width: 1100px;
    background: #fff;
    border: 5px solid #000;
    border-radius: 0;
    padding: 3rem;
    box-shadow: 12px 12px 0px #000;
    margin-top: 4rem;
    margin-bottom: 4rem;
}

.cl-submit-section {
    padding: 6rem 5%;
}

@media (max-width: 768px) {
    .cl-portal-hero-stats-panel {
        flex-direction: column;
        gap: 1.5rem;
    }
    .cl-story-card.rapido-card,
    .cl-form-container,
    .cl-modal.rapido-modal {
        padding: 1.5rem !important;
    }
    .rapido-hero .cl-portal-subline {
        font-size: 0.9rem;
    }
}

/* =========================================
   MOBILE OPTIMIZATION — Added breakpoints
   ========================================= */

/* ---- 992px: fix feed gap ---- */
@media (max-width: 992px) {
  #rapido-feed.cl-feed-grid {
    gap: 2rem;
    padding: 0 1.5rem;
  }
}

/* ---- 768px: card height, submit ---- */
@media (max-width: 768px) {
  .cl-story-card.rapido-card {
    min-height: auto;
    padding: 1.5rem !important;
    gap: 1rem;
  }
  .cl-story-card.rapido-card .cl-story-title {
    font-size: 1.4rem;
  }
  .cl-story-card.rapido-card .cl-story-excerpt,
  .cl-story-card.rapido-card .cl-story-body {
    font-size: 1rem;
  }
  .cl-submit-section {
    padding: 3rem 1.5rem;
  }
  .cl-modal.rapido-modal {
    padding: 1.5rem !important;
  }
}

/* ---- 479px: phone ---- */
@media (max-width: 479px) {
  #rapido-feed.cl-feed-grid {
    gap: 1.5rem;
    padding: 0 1rem;
  }
  .rapido-hero .cl-portal-hero-inner {
    padding: 2rem 1rem;
    gap: 1rem;
  }
  .cl-portal-hero-stats-panel {
    padding: 1rem;
    gap: 1rem;
  }
  .cl-ph-stat span {
    font-size: 2.5rem !important;
  }
  #rapido-slalom-game {
    height: 280px;
  }
  .cl-submit-section {
    padding: 2rem 1rem;
  }
  .cl-modal.rapido-modal {
    padding: 1rem !important;
  }
  .rapido-modal h2 {
    font-size: 1.75rem;
  }
}
