:root {
    --red: #c8102e;
    --gold: #ffd700;
    --dark: #000000;
    --card: #1a1a1a;
    --gray: #333;
    --text: #ffffff;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Arial Black', sans-serif;
    background-color: var(--dark);
    color: var(--text);
    margin: 0;
    padding: 2vh;
    height: 100vh; /* Sztywna wysokość ekranu */
    display: flex;
    justify-content: center;
    overflow: hidden; 
    user-select: none;
}

.wrapper {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
}

/* STYLOWE LOGO Z NAPISEM TEAM A (Zintegrowane) */
.logo-box {
    position: relative;
    margin: 0 auto 2vh auto;
    width: fit-content;
    padding: 10px;
    flex: 0 0 auto;
}

.logo-box img {
    max-height: 10vh;
    width: auto;
    display: block;
    filter: drop-shadow(0 5px 15px rgba(200, 16, 46, 0.4));
}

.badge {
    position: absolute;
    top: 0;
    right: -10px;
    background: var(--gold);
    color: black;
    padding: 4px 15px;
    font-size: 1.2rem;
    font-weight: 900;
    text-transform: uppercase;
    transform: rotate(12deg);
    border: 3px solid black;
    box-shadow: 4px 4px 0 var(--red);
    white-space: nowrap;
    z-index: 10;
}

/* NAGŁÓWEK I JĘZYKI */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 0 0 auto;
    margin-bottom: 2vh;
}

.btn-nav {
    background: var(--gray);
    color: white;
    padding: 1.5vh 3vh;
    border-radius: 15px;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    border: 3px solid var(--red);
    transition: 0.2s;
}

.btn-nav:active {
    transform: scale(0.95);
    background: var(--red);
}

.lang-switch, .flags {
    display: flex;
    gap: 10px;
}

.lang-switch img, .flags img {
    width: 60px;
    border: 3px solid transparent;
    border-radius: 8px;
    opacity: 0.5;
    transition: 0.3s;
}

.lang-switch .active img, .flags a img:hover {
    border-color: var(--gold);
    opacity: 1;
    transform: scale(1.1);
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin: 1vh 0;
    text-transform: uppercase;
    color: var(--gold);
    flex: 0 0 auto;
}

/* KARTA FORMULARZA */
.main-card {
    background: var(--card);
    padding: 3vh;
    border-radius: 30px;
    border: 2px solid #222;
    flex: 0 0 auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.label-text {
    font-size: 1.2rem;
    color: var(--gold);
    margin-bottom: 1vh;
    display: block;
    text-transform: uppercase;
}

input[type="text"], textarea {
    width: 100%;
    background: #000;
    border: 3px solid var(--gray);
    border-radius: 15px;
    color: white;
    padding: 1.5vh;
    font-size: 1.5rem;
    margin-bottom: 1.5vh;
    outline: none;
    font-family: sans-serif;
}

input:focus, textarea:focus {
    border-color: var(--red);
}

textarea {
    height: 10vh;
    resize: none;
}

/* SIATKA WYBORU (vote.php) */
.ideas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 2vh;
    max-height: 15vh;
    overflow-y: auto;
    padding: 5px;
}

.idea-btn input { display: none; }

.idea-content {
    display: block;
    background: var(--gray);
    padding: 15px;
    border-radius: 12px;
    font-size: 1.1rem;
    text-align: center;
    border: 3px solid transparent;
    cursor: pointer;
    transition: 0.2s;
}

.idea-btn input:checked + .idea-content {
    background: var(--red);
    border-color: var(--gold);
    transform: scale(0.98);
}

/* PRZYCISKI AKCJI */
.vote-button, .submit-button {
    width: 100%;
    padding: 2vh;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 1.8rem;
    font-weight: bold;
    box-shadow: 0 8px 0 #8b0a1e;
    cursor: pointer;
    text-transform: uppercase;
}

.vote-button:active, .submit-button:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 #8b0a1e;
}

/* SEKCJA DOLNA (WYNIKI / LISTA) */
.results-section, .list-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-top: 2vh;
}

h2 {
    font-size: 1.8rem;
    text-align: center;
    margin: 0 0 1.5vh 0;
    color: var(--gold);
    text-transform: uppercase;
}

/* Wykres (vote.php) */
.results-container {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 20px;
    padding: 10px;
    background: rgba(255,255,255,0.02);
    border-radius: 20px;
    min-height: 0;
    overflow-x: auto;
}

.bar-group {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    min-width: 80px;
    max-width: 140px;
}

.bar-track {
    width: 70%;
    background: rgba(255,255,255,0.05);
    flex: 1;
    display: flex;
    align-items: flex-end;
    border-radius: 15px 15px 0 0;
    border: 1px solid #222;
}

.bar-fill {
    width: 100%;
    transition: height 1.2s ease-out;
    display: flex;
    justify-content: center;
    border-radius: 12px 12px 0 0;
    position: relative;
}

.bar-fill span { 
    font-size: 1.2rem; 
    position: absolute; 
    top: 5px; 
    font-weight: bold; 
    text-shadow: 0 0 5px black;
}

.bar-name {
    font-size: 0.9rem;
    text-align: center;
    margin-top: 8px;
    color: #ccc;
    width: 100%;
    word-break: break-word;
    min-height: 2.5em;
}

/* Lista pomysłów (index.php) */
.idea-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    overflow-y: auto;
    padding-right: 10px;
}

.idea-card {
    background: var(--card);
    padding: 15px;
    border-radius: 15px;
    border-left: 8px solid var(--red);
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

.idea-card strong {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.idea-card .author {
    font-size: 0.9rem;
    color: var(--gold);
}

/* OVERLAY */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    text-align: center;
}

.overlay h3 { font-size: 4rem; color: var(--gold); margin: 0; }
.overlay p { font-size: 1.5rem; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }