/* 1. ALAP STÍLUSOK & HÁTTÉR */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    /*background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);*/
    background-color: #000 !important;
    color: #f8fafc;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}


.ngame-grid > h4 {
    margin-bottom: 30px;
}


.hidden {
    display: none !important;
}

/* 2. KÁRTYA KONTÉNER (Üveghatás) */
.card-container {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 35px 25px;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    text-align: center;
    transition: all 0.3s ease;
}

#teamListContainer {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.team-manager {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 35px 25px;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-row {
    display: flex;
    flex-direction: row; /* Mobilon egymás alá rakja az elemeket */
    gap: 10px; /* Mezők közötti távolság mobilon */
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.form-row-new {
    background: rgba(100, 100, 100, 0.3) !important;
}

.form-row:has(.form-input:disabled) {
    display: flex;
    flex-direction: row; /* Mobilon egymás alá rakja az elemeket */
    gap: 10px; /* Mezők közötti távolság mobilon */
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    opacity: 0.2;
    transition: all 0.3s ease;
}

.form-input {
    padding: 3px;
    font-size: 16px; /* Mobilon a 16px meggátolja az automatikus zoomolást */
    border: 1px solid #ccc;
    border-radius: 4px;
    flex: 3; /* Kitölti a rendelkezésre álló helyet */
}

.form-div {
    width: 50px;
    height: 50px;
    padding: 3px;
    /*background: #e9ecef;*/
    background: transparent;
    border: 2px solid #495057;
    border-radius: 4px;
    /*font-size: 14px;
    color: #495057;*/
    overflow: hidden;
    flex: 0.5; /* Kitölti a rendelkezésre álló helyet */
}

.form-div img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.form-btn {
    width: 60px;
    height: 50px;
    padding: 3px 3px;
    font-size: 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    flex: 0.5;
    overflow: hidden;
}

@media (min-width: 800px) {
    .form-btn i {
	font-size: 1.5vw;
	color: #fff;
    }
}

.form-btn i {
    font-size: 5vw;
    color: #fff;
}

@media (min-width: 800px) {
    .form-btn i {
	font-size: 1.5vw;
	color: blue;
    }
}

.displayIcon {
    position: fixed;
    top: 8px;
    left: 8px;
    width: 41px;
    height: 41px;
    padding: 3px;
    background: #9d9d9d;
    border: 5px solid #3f3f3f;
    border-radius: 25px;
    color: #6d6d6d;
}

@media (min-width: 800px) {
.displayIcon {
    position: absolute;
    width: 41px;
    height: 41px;
    padding: 3px;
    background: #9d9d9d;
    border: 5px solid #3f3f3f;
    border-radius: 25px;
    color: #6d6d6d;
}
}
.displayIcon i {
    font-size: 25px;
    line-height: 28px;
}

.displayIcon.online {
    background: #e6f4ea;
    border: 5px solid #34a853;
    border-radius: 25px;
    color: #137333;
}

.displayIcon.offline {
    background: #fce8e6;
    border: 5px solid #ea4335;
    border-radius: 25px;
    color: #c5221f;
}

#app-section {
    max-width: 500px;
}

#teams-section {
    max-width: 500px;
}

#teamManager {
    max-width: 500px;
}

h2 {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 24px;
}

/* 3. ŰRLAP ELEMEK & INPUTOK */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid #334155;
    border-radius: 12px;
    color: #ffffff;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
    appearance: none;
}

select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://w3.org' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    cursor: pointer;
}

input:focus, select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* 4. CSAPAT VÁLASZTÓ ÉS EREDMÉNYJELZŐ RÁCS */
.teams-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.score-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 8px 12px;
    margin-top: 6px;
}

.score-display {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    font-family: monospace;
    min-width: 30px;
    text-align: center;
}

.btn-score {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
}

/* 5. IDŐZÍTŐ DIGITÁLIS KIJELZŐ */
.timer-display {
    font-family: 'Courier New', Courier, monospace;
    font-size: 54px;
    font-weight: bold;
    color: #38bdf8;
    background: rgba(15, 23, 42, 0.8);
    padding: 15px;
    border-radius: 16px;
    border: 1px solid #334155;
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

/* 6. IDŐZÍTŐ VEZÉRLŐ GOMBOK */
.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.window-ctrl {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

button {
    padding: 12px;
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s;
}

button:active {
    transform: scale(0.96);
}

button:disabled {
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid #475569;
    color: #cbd5e1;
}

/* Gomb színvariációk */
.btn-primary { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); width: 100%; padding: 14px; font-size: 16px;}
.btn-primary:hover { box-shadow: 0 0 20px rgba(99, 102, 241, 0.4); }

.btn-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.btn-success:hover { box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); }

.btn-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.btn-warning:hover { box-shadow: 0 0 15px rgba(245, 158, 11, 0.4); }

.btn-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.btn-danger:hover { box-shadow: 0 0 15px rgba(239, 68, 68, 0.4); }

.btn-secondary {
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid #475569;
    color: #cbd5e1;
}
.btn-secondary:hover { background: rgba(51, 65, 85, 0.8); }

.logout-wrapper {
    margin-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

#error-msg {
    color: #f87171;
    font-size: 14px;
    margin-top: 12px;
    min-height: 20px;
}

/* ==========================================================================
   ANDROID PWA & iOS SAFE-OPTIMIZED TOGGLE SWITCH
   ========================================================================== */

/* 1. KÜLSŐ TÁROLÓ (LABEL)
   Kikényszeríti a fix méretet és letiltja a mobilos torzításokat. */
.switch {
  position: relative;
  /* Blokként kezeljük, hogy az Android Chrome ne tudja eltorzítani a flexbox miatt */
  display: block !important; 
  width: 60px !important;
  height: 34px !important;
  min-width: 60px !important;
  min-height: 34px !important;
  margin: 0;
  padding: 0;
  
  /* Megakadályozza, hogy a szülő flexbox container összepréselje vagy széthúzza */
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  
  box-sizing: border-box;
  /* JAVÍTÁS iOS-RE: Letiltja a duplakattintásos képernyő-nagyítást a gombon */
  touch-action: manipulation; 
  /* Eltünteti az iOS alapértelmezett kék/szürke villanását kattintáskor */
  -webkit-tap-highlight-color: transparent;
}

/* Minden belső elem dobozmodelljét elszigeteljük a külső CSS hatásoktól */
.switch, 
.switch * {
  box-sizing: border-box !important;
}

/* 2. REJTETT, DE KATTINTHATÓ INPUT
   A legfelső rétegen fekszik, így az ujjunk biztosan ezt éri el. */
.switch input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  /* Legfelülre helyezzük, hogy a touch eseményeket azonnal elkapja */
  z-index: 3; 
  
  /* Mobil gyári stílusok (checkbox pipa/négyzet) teljes letiltása */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* 3. A GOMB HÁTTERE (Alapértelmezett OFF állapot) */
.switch .slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  background-color: #e4e4e7; /* Kellemes világosszürke */
  border-radius: 34px;
  transition: background-color 0.25s ease;
  z-index: 1;
}

/* 4. A BELSŐ MOZGÓ FEHÉR KÖR */
.switch .slider::before {
  content: "";
  position: absolute;
  height: 26px !important;
  width: 26px !important;
  min-height: 26px !important;
  min-width: 26px !important;
  left: 4px;
  top: 4px;
  background-color: #ffffff;
  border-radius: 50%;
  /* Android-optimalizált alaphelyzet */
  transform: translateX(0);
  /* Sima, prémium érzetű animáció */
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

/* 5. AKTÍV (ON) ÁLLAPOTOK
   A modern :has() szelektorral kényszerítjük ki az Android Chrome-on a biztos frissítést. */

/* Ha az input be van jelölve, a háttér zöldre vált */
.switch:has(input:checked) .slider {
  background-color: #22c55e; /* Modern neonos zöld */
}

/* Ha az input be van jelölve, a kör eltolódik jobbra */
.switch:has(input:checked) .slider::before {
  transform: translateX(26px);
}}