/* TEMEL AYARLAR - Responsive Tasarım İçin */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #faeede !important; /* İstediğiniz arka plan rengi */
    color: #333;
    
    font-size: 14px;
    line-height: 1.5;
    padding: 10px;
    min-height: 100vh;
}

/* Mobil Cihazlar için Responsive Ayarlar */
@media screen and (max-width: 768px) {
    body {
        font-size: 13px;
        padding: 8px;
    }
    
    table {
        width: 100% !important;
        display: block;
        overflow-x: auto;
    }
}

@media screen and (max-width: 480px) {
    body {
        font-size: 12px;
        padding: 5px;
    }
}

/* ÜST BİLGİ ÇUBUĞU - Responsive */
table[width="100%"]:first-of-type {
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 15px;
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

table[width="100%"]:first-of-type tr {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

table[width="100%"]:first-of-type td {
    padding: 5px;
    display: inline-block;
}

/* HP Göstergesi için Responsive Tasarım */
#HP {
    font-size: 11px;
    color: #d9534f;
    font-weight: bold;
    white-space: nowrap;
    display: inline-block;
}

#HP1, #HP2 {
    height: 8px !important;
    border-radius: 3px;
    display: inline-block;
    vertical-align: middle;
}

/* Butonlar - Responsive */
table[width="100%"]:first-of-type input[type="button"] {
    background: linear-gradient(to bottom, #5cb85c, #4cae4c);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin: 3px;
    font-size: 12px;
    white-space: nowrap;
    transition: all 0.3s ease;
    display: inline-block;
}

table[width="100%"]:first-of-type input[type="button"]:hover {
    background: linear-gradient(to bottom, #4cae4c, #5cb85c);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Özel buton sınıfları */
input.podskazka {
    background: linear-gradient(to bottom, #337ab7, #286090) !important;
}

input.podskazka:hover {
    background: linear-gradient(to bottom, #286090, #337ab7) !important;
}

input.cur {
    background: linear-gradient(to bottom, #f0ad4e, #ec971f) !important;
}

input.cur:hover {
    background: linear-gradient(to bottom, #ec971f, #f0ad4e) !important;
}

/* Mobil için buton boyutu ayarı */
@media screen and (max-width: 768px) {
    table[width="100%"]:first-of-type input[type="button"] {
        padding: 6px 10px;
        font-size: 11px;
        margin: 2px;
    }
}

@media screen and (max-width: 480px) {
    table[width="100%"]:first-of-type {
        padding: 8px 10px;
    }
    
    table[width="100%"]:first-of-type input[type="button"] {
        padding: 5px 8px;
        font-size: 10px;
        margin: 1px;
    }
    
    /* Küçük ekranlarda butonları yan yana yerine alt alta */
    table[width="100%"]:first-of-type tr {
        flex-direction: column;
        align-items: stretch;
    }
    
    table[width="100%"]:first-of-type td {
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 5px;
    }
}

/* SAVAŞ ARŞİV TABLOSU - Responsive */
table[width="100%"][cellspacing="0"][cellpadding="5"] {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

table[width="100%"][cellspacing="0"][cellpadding="5"] tr {
    border-bottom: 1px solid #eee;
}

table[width="100%"][cellspacing="0"][cellpadding="5"] tr:last-child {
    border-bottom: none;
}

table[width="100%"][cellspacing="0"][cellpadding="5"] tr.l0 {
    background-color: #f9f9f9;
}

table[width="100%"][cellspacing="0"][cellpadding="5"] tr.l1 {
    background-color: white;
}

table[width="100%"][cellspacing="0"][cellpadding="5"] tr:hover {
    background-color: #f0f9f0;
}

table[width="100%"][cellspacing="0"][cellpadding="5"] td {
    padding: 12px 15px;
    vertical-align: top;
    border-right: 1px solid #eee;
}

table[width="100%"][cellspacing="0"][cellpadding="5"] td:last-child {
    border-right: none;
}

/* Mobil için savaş arşiv tablosu */
@media screen and (max-width: 768px) {
    table[width="100%"][cellspacing="0"][cellpadding="5"] {
        display: block;
        overflow-x: auto;
    }
    
    table[width="100%"][cellspacing="0"][cellpadding="5"] td {
        padding: 10px 12px;
        min-width: 100px;
        font-size: 12px;
    }
    
    table[width="100%"][cellspacing="0"][cellpadding="5"] td:first-child {
        min-width: 50px;
    }
}

@media screen and (max-width: 480px) {
    table[width="100%"][cellspacing="0"][cellpadding="5"] td {
        padding: 8px 10px;
        font-size: 11px;
        display: block;
        width: 100% !important;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    table[width="100%"][cellspacing="0"][cellpadding="5"] tr {
        display: block;
        margin-bottom: 10px;
        border: 1px solid #ddd;
        border-radius: 5px;
        overflow: hidden;
    }
    
    table[width="100%"][cellspacing="0"][cellpadding="5"] td:first-child {
        background-color: #f5f5f5;
        font-weight: bold;
        border-bottom: 2px solid #5cb85c;
    }
}

/* ANA NAVİGASYON MENÜSÜ - Responsive */
table[align="center"][width="100%"] {
    background: linear-gradient(135deg, #2c4d80, #1a365f);
    border-radius: 8px;
    overflow: hidden;
    margin: 15px auto;
    border: 1px solid #1a3c6e;
    width: 100%;
    display: table;
}

table[align="center"][width="100%"] tr {
    display: flex;
    flex-wrap: wrap;
}

table[align="center"][width="100%"] td {
    padding: 10px 5px !important;
    text-align: center;
    flex: 1;
    min-width: 100px;
    border-right: 1px solid rgba(255,255,255,0.1);
}

table[align="center"][width="100%"] td:last-child {
    border-right: none;
}

table[align="center"][width="100%"] td.s {
    background-color: rgba(255,255,255,0.1);
    border-bottom: 3px solid #5cb85c;
}

table[align="center"][width="100%"] a.f {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 5px;
    display: block;
    transition: color 0.3s;
    font-size: 13px;
}

table[align="center"][width="100%"] a.f:hover {
    color: #5cb85c;
}

/* Mobil için navigasyon */
@media screen and (max-width: 768px) {
    table[align="center"][width="100%"] td {
        min-width: 80px;
        padding: 8px 3px !important;
    }
    
    table[align="center"][width="100%"] a.f {
        font-size: 12px;
        padding: 6px 3px;
    }
}

@media screen and (max-width: 480px) {
    table[align="center"][width="100%"] td {
        min-width: 70px;
        padding: 6px 2px !important;
    }
    
    table[align="center"][width="100%"] a.f {
        font-size: 11px;
        padding: 5px 2px;
    }
}

/* FORM ALANLARI - Responsive */
form, table[cellspacing="0"][cellpadding="0"] {
    background-color: #faeede;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #ddd;
    margin: 15px auto;
    max-width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
}

fieldset {
    border: 2px solid #5cb85c;
    border-radius: 6px;
    padding: 15px;
    background-color: #f9f9f9;
    width: 100%;
}

legend {
    color: #000000;
    font-weight: bold;
    padding: 0 10px;
    font-size: 14px;
}


/* SAVAŞ SONUÇLARI - TELEFON İÇİN KESİN ÇÖZÜM */
.battle-results-container {
    margin: 0 auto;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.battle-results-header {
    text-align: center;
    color: #2c3e50;
    font-size: 18px;
    margin: 0 0 15px 0;
    padding: 0 0 8px 0;
    border-bottom: 2px solid #e74c3c;
    font-weight: bold;
    width: 100%;
}

/* TABLO WRAPPER - MOBİL ÖNCELİKLİ */
.results-tables-wrapper {
    display: block;
    width: 100%;
    margin: 0 auto;
}

/* TABLO - MOBİL İÇİN SADELESTİRİLMİŞ */
.battle-result-table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #ddd;
    margin-bottom: 15px;
    display: table !important;
    table-layout: fixed !important;
}

/* BAŞLIK SATIRI */
.battle-result-table thead tr {
    background: #3498db;
    display: table-row !important;
}

.battle-result-table thead td {
    padding: 10px 5px !important;
    text-align: center !important;
    font-weight: bold;
    color: white;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    display: table-cell !important;
    border: none !important;
}

/* İÇERİK SATIRLARI */
.battle-result-table tbody tr {
    display: table-row !important;
    border-bottom: 1px solid #eee;
}

.battle-result-table tbody tr:last-child {
    border-bottom: none;
}

/* HÜCRELER - EN ÖNEMLİ KISIM */
.battle-result-table tbody td {
    padding: 8px 5px !important;
    vertical-align: middle !important;
    display: table-cell !important;
    border: none !important;
    font-size: 12px;
    line-height: 1.2 !important;
}

/* SOL HÜCRE (Personaj + Zarba) */
.battle-result-table tbody td:first-child {
    width: 70% !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 0;
    padding-left: 8px !important;
}

/* SAĞ HÜCRE (Sayı) */
.battle-result-table tbody td:last-child {
    width: 30% !important;
    text-align: right !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    padding-right: 8px !important;
    color: #e74c3c;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

/* PERSONAJ METNİNİ DÜZENLE */
.battle-result-table tbody td:first-child br {
    display: none !important; /* BR'leri gizle */
}

/* MOBİL İÇİN METİN DÜZENLEMESİ */
@media screen and (max-width: 768px) {
    .battle-result-table {
        min-width: 100% !important;
        max-width: 100% !important;
    }
    
    /* BAŞLIK */
    .battle-result-table thead td {
        font-size: 12px !important;
        padding: 8px 4px !important;
    }
    
    /* İÇERİK */
    .battle-result-table tbody td {
        font-size: 11px !important;
        padding: 6px 4px !important;
    }
    
    .battle-result-table tbody td:first-child {
        width: 65% !important;
        padding-left: 6px !important;
    }
    
    .battle-result-table tbody td:last-child {
        width: 35% !important;
        padding-right: 6px !important;
        font-size: 11px !important;
    }
}

/* ÇOK KÜÇÜK EKRANLAR */
@media screen and (max-width: 360px) {
    .battle-result-table thead td {
        font-size: 11px !important;
        padding: 6px 3px !important;
    }
    
    .battle-result-table tbody td {
        font-size: 10px !important;
        padding: 5px 3px !important;
    }
    
    .battle-result-table tbody td:first-child {
        width: 60% !important;
        padding-left: 5px !important;
    }
    
    .battle-result-table tbody td:last-child {
        width: 40% !important;
        padding-right: 5px !important;
        font-size: 10px !important;
    }
}

/* PC İÇİN */
@media screen and (min-width: 769px) {
    .battle-results-container {
        max-width: 1200px;
        padding: 20px;
    }
    
    .battle-results-header {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    .results-tables-wrapper {
        display: flex !important;
        justify-content: center;
        gap: 40px;
        flex-wrap: wrap;
    }
    
    .battle-result-table {
        width: auto !important;
        min-width: 300px;
        max-width: 400px;
        margin-bottom: 0;
        border: 2px solid #3498db;
        border-radius: 10px;
    }
    
    .battle-result-table thead td {
        padding: 15px 20px !important;
        font-size: 16px !important;
    }
    
    .battle-result-table tbody td {
        padding: 12px 15px !important;
        font-size: 14px !important;
    }
    
    .battle-result-table tbody td:first-child {
        width: 200px !important;
        white-space: normal !important;
        max-width: none !important;
        padding-left: 15px !important;
    }
    
    .battle-result-table tbody td:last-child {
        width: 100px !important;
        padding-right: 15px !important;
        font-size: 14px !important;
    }
}

/* TABLET */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .results-tables-wrapper {
        gap: 30px;
    }
    
    .battle-result-table {
        min-width: 280px;
    }
}

/* EĞER BR ETİKETLERİ PROBLEM YARATIYORSA */
.battle-result-table * {
    line-height: 1.2 !important;
}

/* İÇERİKTEKİ BOŞLUKLARI DÜZENLE */
.battle-result-table tbody td:first-child {
    word-spacing: normal !important;
    letter-spacing: normal !important;
}

/* FIREFOX İÇİN */
@-moz-document url-prefix() {
    .battle-result-table tbody td:first-child {
        white-space: -moz-nowrap !important;
    }
}

/* Mobil form ayarları */
@media screen and (max-width: 768px) {
    form, table[cellspacing="0"][cellpadding="0"] {
        padding: 12px;
        margin: 12px auto;
    }
    
    fieldset {
        padding: 12px;
    }
}

@media screen and (max-width: 480px) {
    form, table[cellspacing="0"][cellpadding="0"] {
        padding: 10px;
        margin: 10px auto;
    }
    
    fieldset {
        padding: 10px;
    }
    
    legend {
        font-size: 13px;
    }
}

/* SELECT ve INPUT ALANLARI - Responsive */
select, input[type="submit"], input[name="open"], input[name="recall"] {
    background-color: white;
    color: #333;
    border: 1px solid #ccc;
    padding: 8px 12px;
    margin: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
    width: auto;
    display: inline-block;
}

select:hover, input[type="submit"]:hover, input[name="open"]:hover {
    border-color: #5cb85c;
    background-color: #f0f9f0;
}


select.new:hover, input.new:hover {
    background-color: #4cae4c;
}

/* Mobil input ayarları */
@media screen and (max-width: 768px) {
    select, input[type="submit"], input[name="open"], input[name="recall"] {
        padding: 6px 10px;
        margin: 4px;
        font-size: 12px;
    }
    
    select.new, input.new {
        padding: 6px 12px;
    }
}

@media screen and (max-width: 480px) {
    select, input[type="submit"], input[name="open"], input[name="recall"] {
        padding: 5px 8px;
        margin: 3px;
        font-size: 11px;
    }
    
    select.new, input.new {
        padding: 5px 10px;
    }
    
    /* Form elemanlarını blok yapıyoruz */
    select, input[type="text"], input[type="number"] {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* ZAYAVKA LİSTESİ - Responsive */
form[method="POST"] {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

form[method="POST"] > div {
    background-color: white;
    border-left: 4px solid #5cb85c;
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 5px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    width: 100%;
    display: block;
}

form[method="POST"] > div:hover {
    transform: translateX(3px);
    background-color: #f9f9f9;
}

/* Bot zayavkaları için özel stil */
form[method="POST"] > div:has(input[name="bot_combat"]) {
    border-left-color: #d9534f;
    background-color: #fff5f5;
}

form[method="POST"] > div:has(input[name="bot_combat"]) b span {
    color: #d9534f !important;
}

/* Radio butonlar için responsive stil */
input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.1);
}


/* ÇEŞİTLİ METİN AYARLARI - Responsive */
i[style*="color:#191970"] {
    color: #2c4d80 !important;
    font-style: normal;
    font-weight: bold;
    margin: 0 5px;
}

p[style*="color: #6c757d"] {
    color: #6c757d !important;
    text-align: center;
    font-style: italic;
    padding: 15px;
    font-size: 13px;
    background-color: white;
    border-radius: 6px;
    margin: 15px auto;
}

/* Resimler için responsive ayar */
img {
    max-width: 100%;
    height: auto;
}



/* Mobil için özel düzenlemeler */
@media screen and (max-width: 768px) {
    form[method="POST"] > div {
        padding: 10px 12px;
        margin: 8px 0;
    }
    
    b[style*="color:#ff0000"] {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    p[style*="color: #6c757d"] {
        padding: 12px;
        font-size: 12px;
    }
}

@media screen and (max-width: 480px) {
    form[method="POST"] > div {
        padding: 8px 10px;
        margin: 6px 0;
        font-size: 12px;
    }
    
    /* Küçük ekranlarda içerik sığdırma */
    .mobil-satir {
        display: block !important;
        margin-bottom: 5px;
    }
    
    /* Tablo hücrelerini blok yapma */
    table tr {
        display: block;
    }
    
    table td {
        display: block;
        width: 100% !important;
        text-align: left !important;
        padding: 8px 5px !important;
    }
}

/* Özel Mobil Sınıfları */
.mobil-gizle {
    display: none;
}

.mobil-goster {
    display: block;
}

@media screen and (min-width: 769px) {
    .mobil-goster {
        display: none;
    }
}

/* Flexbox düzenlemeleri */
.flex-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.flex-item {
    flex: 1;
    min-width: 200px;
}

/* Responsive grid sistemi */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    width: 100%;
}

@media screen and (max-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px;
    }
}

@media screen and (max-width: 480px) {
    .grid-container {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* Scroll bar için responsive ayar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}