@import url('https://fonts.googleapis.com/css2?family=Satisfy&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Solitreo&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Babylonica&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Acme&display=swap');

/* Yleinen tyyli */
body {
    margin: 0;
    padding: 0;
    background: url('image/metsa.jpg') no-repeat center center fixed;
    background-size: cover;
    font-family: 'Georgia', serif;
    color: #e5e5e5;
}

/* Yläpalkki */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 20, 10, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    flex-wrap: wrap; /* sallii rivittymisen pienillä näytöillä */
    justify-content: flex-start;
	gap: 40px; 
    align-items: center;
    padding: 12px 30px;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

/* Otsikko */
.logo {
    font-family: 'Satisfy', cursive;
    font-size: 45px;
    color: #c6a108;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0,0,0,0.6);
}

/* Navigaatio */
.nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    padding-bottom: 4px;
}


.nav::-webkit-scrollbar {
    height: 6px;
}

.nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}
.nav a {
    color: #b89609;
    text-decoration: none;
    font-size: 18px;
    font-family: 'Open Sans', sans-serif;
    text-transform: uppercase;
    transition: color 0.3s, text-shadow 0.3s;
    white-space: nowrap;
    margin: 0; /* tärkeä: poistaa liiallisen tilankäytön */
}


.nav a:hover {
    color: #b4d8b4;
    text-shadow: 0 0 6px rgba(180,216,180,0.6);
}
/* Mini-navigaatio  */
.mini-nav {
    display: flex;
    gap: 12px;
    margin: 15px 0 25px 0;
    padding: 10px 12px;
    background-color: #1f1f1f;
    border: 1px solid #333;
    border-radius: 6px;
}

.mini-nav a {
    color: #8ab4ff;
    text-decoration: none;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 4px;
    transition: 0.2s ease;
}

.mini-nav a:hover {
    background-color: #2a2a2a;
    color: #a8c8ff;
}

.decorative-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto 0px auto;
    max-width: 1000px; /* sama kuin content-wrapper */
    width: 100%;
}

.divider-icon {
    display: block;
    width: 100%;          /* täyttää koko käytettävissä olevan leveyden */
    max-width: 1000px;    /* ei koskaan leveämpi kuin content-wrapper */
    aspect-ratio: 2 / 1;  /* säädä hevosen muodon mukaan */
    background-image: url('image/siluetti.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 0 12px rgba(198,161,8,0.9));
}


/* Sisältöalue */
.content-wrapper {
    max-width: 1000px;
    margin: 40px auto 80px auto;
    background: rgba(0, 0, 0, 0.55);
    padding: 50px;
    border-radius: 10px;
    box-shadow: 0 0 25px rgba(0,0,0,0.5);
}
.content-wrapper a {
    color: #c6a108;
    text-decoration: none;
	letter-spacing: 0.5px
}
.content-wrapper a:hover {
	letter-spacing: 0.6px
}
.allekirjoitus {
	font-family: 'Babylonica', cursive;
  	font-size: 31px;
}

/* Otsikot ja tekstit */
h1 {
    font-family: 'Cinzel', serif;
    color: #c6a108;
    text-align: center;
    margin-bottom: 20px;
}
h2 {
    text-align: center;
    color: #e0d7c2;
    margin-bottom: 18px;
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}
h3 {
    color: #e0d7c2;
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}
p {
    line-height: 1.6;
    font-size: 16px;
    text-align: center;
}
.history-box {
    background: rgba(10, 20, 10, 0.7);
    padding: 25px 30px;
    margin: 35px auto 45px auto;
    max-width: 850px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
	font-family: "Solitreo", cursive;
	font-weight: 400;
	font-style: normal;
    line-height: 1.7;
}


/* Kortit */
.cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
	max-width: 900px;
    margin: 0 auto;
}
.cards a {
	color: #d8c9a6;
	text-decoration: none;          /* ei alleviivausta */
    transition: 2s; 
}
.cards a:hover {
	color: #ffd678; 
	letter-spacing: 0.8px;
	text-shadow: 0 0 4px rgba(255,205,0,0.4);
}
.card {
    background: rgba(20, 30, 20, 0.8);
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.6);
    overflow: visible;
    width: 280px;
    text-align: center;
    opacity: 1;
    transform: scale(1);
    transition: 
        opacity 0.65s ease,
        transform 0.65s ease,
        box-shadow 0.3s; /* säilytetään hover-efekti */
}
/* Fade + zoom out */
.card.hiding {
    opacity: 0;
    transform: scale(0.94);
    transition:
        opacity 0.65s ease-in-out,
        transform 0.65s ease-in-out;
}
/* Poistetaan layoutista */
.card.hidden {
    display: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px rgba(180,216,180,0.4);
}

.card img {
    width: auto;          /* ei venytetä kortin leveyteen */
    height: 130px;        /* käytetään ikonien todellista korkeutta */
    max-width: 100%;      /* varmistaa ettei ylitä korttia */
    object-fit: contain;  /* pitää mittasuhteet */
    display: block;
    margin: 0 auto 15px;  /* keskitys */
}


.card h2 {
    font-family: 'Cinzel', serif;
    color: #f0eee1;
    margin: 15px 0 5px 0;
}

.card p {
    font-size: 15px;
    color: #cfcfcf;
    margin: 0 15px 20px 15px;
}
.card strong {
    color: #d8cfa8;          /* pehmeä, neutraali kultainen */
    font-size: 0.85rem;      /* hieman pienempi ja kevyempi */
    line-height: 1.25;       /* tiiviimpi riviväli */
    padding: 2px 0 2px 0;     /* pienempi väli ylä- ja alapuolella */
    font-weight: 400;        /* kevyempi kuin bold, mutta ei ohut */
    letter-spacing: 0.5px;   /* lisää ilmavuutta */
}
.filter-buttons {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-buttons button {
    background: #1b1b1b;
    border: 1px solid #c6a108;
    color: #c6a108;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: 1.5s ease;
}

.filter-buttons button:hover {
    background: #2a2a2a;
    color: #ffcd00;
    border-color: #ffcd00;
}

.filter-buttons button.active {
    background: #c6a108;
    color: #1b1b1b;
    font-weight: 500;
	letter-spacing: 0.6px;
}

/* Painikkeet */
.btn {
    display: inline-block;
    background: linear-gradient(135deg, #3b5f3b, #5f8b5f);
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.3s, box-shadow 0.3s;
}

.btn:hover {
    background: linear-gradient(135deg, #4b7a4b, #7fa97f);
    box-shadow: 0 0 10px rgba(180,216,180,0.5);
}
.footer {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; /* estää sivuttaisvierityksen */
    background: rgba(0, 0, 0, 0.35);
    color: #d4e6d1;
    padding: 15px 30px;
    margin-top: 40px;
    display: flex;
    justify-content: center;
	gap: 50px; /* säädä leveyttä */
    align-items: center;
    font-size: 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
    box-sizing: border-box; /* tärkeä: estää leveysylitykset */
}
.footer p {
	font-size: 12px; !important;
	margin: 0;
}

.footer-left,
.footer-right {
    display: flex;
    align-items: center;
}

.footer-right a {
    color: #b4d8b4;
    text-decoration: none;
    margin: 0 6px; /* ei margin-left joka venyttää */
    white-space: nowrap; /* estää rivittymisen kesken sanan */
    transition: color 0.2s;
}

.footer-right a:hover {
    color: #d4e6d1;
}
* {
    box-sizing: border-box;
}

.add-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(10, 20, 10, 0.65);
    padding: 25px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.add-form label {
    font-weight: bold;
    color: #c6a108;
}

.add-form input,
.add-form select,
.add-form textarea {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #444;
    background: rgba(255,255,255,0.1);
    color: #989102;
}

.add-form textarea {
    min-height: 100px;
}

.accordion {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #1179ff2b;
    border: 1px solid rgba(255,255,255,0.1);
}

.accordion input {
    display: none;
}

.accordion-label {
    display: block;
    padding: 12px 15px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(198,161,8,0.15);
    color: #c6a108;
    font-family: 'Cinzel', serif;
}

.accordion-label:hover {
    background: rgba(198,161,8,0.25);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    padding: 0 15px;
}

.accordion input:checked ~ .accordion-content {
    max-height: 3000px;
    padding: 15px;
}

.accordion-content label {
    display: block;
    margin-top: 10px;
    color: #fff;
}

.accordion-content input,
.accordion-content textarea,
.accordion-content select {
    width: 100%;
    margin-top: 5px;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #444;
    background: rgba(255,255,255,0.1);
    color: #008a79;
}

.delete-btn {
    color: #c62828;
    margin-left: 10px;
    text-decoration: none;
    font-size: 16px;
}

.delete-btn:hover {
    color: #ff4444;
}
.back-button {
    display: inline-block;
    margin-bottom: 20px;
    padding: 8px 14px;
    background-color: #eee;
    color: #333;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-button:hover {
    background-color: #ddd;
}
.genotype-box {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 4px;
  background-color: #f2f2f2;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  font-size: 0.9em;
  line-height: 1;
  vertical-align: middle;
  color: #333;
  font-family: 'Segoe UI', sans-serif;
}

.profiilikuva img {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: 8px;
}

.kuvagalleria {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 25px 0;
}
.kuva-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 180px;
}

.kuva-item img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s ease;
}

.kuva-item img:hover {
    transform: scale(1.03);
}

.kuvaaja {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

.kuvaaja a {
    color: #4a7dbb;
    text-decoration: none;
}

.kuvaaja a:hover {
    text-decoration: underline;
}
.kuvagalleria img {
    width: 180px;
    height: auto;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s ease;
}

.kuvagalleria img:hover {
    transform: scale(1.03);
}
.in-memoriam {
    margin: 30px 0;
    padding: 20px;
    border: 2px solid #b8a9a1;
    border-radius: 10px;
    background: linear-gradient(135deg, #faf7f5, #f2ece8);
    text-align: center;
    box-shadow: 0 0 10px rgba(80, 60, 50, 0.15);
}

.in-memoriam-title {
    font-size: 1.6em;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 10px;
    color: #5a4a42;
    text-transform: uppercase;
}

.in-memoriam-text {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: #4a3f39;
}

.in-memoriam-muisto {
    font-size: 1em;
    color: #6a5a52;
    margin-top: 10px;
    white-space: pre-line;
}

.hevonen-nimi {
    font-family: "Acme", sans-serif;
    font-weight: 500;
    font-size: xxx-large;
    color: #c6a108;
    text-align: center;
    margin: 0 0 10px 0;
    letter-spacing: 1.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.meriitti-rivi {
    font-size: 20px;
    font-weight: 500;
	font-family: 'Trebuchet MS', sans-serif;
    color: #beb386;
    margin-top: -10px;     /* nostaa lähemmäs otsikkoa */
    margin-bottom: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
}

.perustiedot {
    max-width: 700px;
    margin: 30px auto;
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.05); /* kevyt läpikuultava */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    backdrop-filter: blur(4px);
	font-size: 15px;
}

.tieto {
    display: flex;
    gap: 15px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.tieto a {
	color: #c6a108;                 /* kultainen sävy, samaa maailmaa kuin h1 */
    text-decoration: none;          /* ei alleviivausta */
    transition: color 0.2s ease;    /* pehmeä hover */
}

.tieto a:hover {
    color: #e8d27c;                 /* vaaleampi kulta hoverissa */
}

.tieto:last-child {
    border-bottom: none;
}

.label {
    font-weight: 600;
    color: #e0d7c2;
    min-width: 160px;
	margin-right: 40px;
}

.value {
    color: #f5f5f5;
    flex: 1;
}

.genotype-box {
    background: rgba(255, 255, 255, 0.22);   /* hieman vahvempi kontrasti */
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 6px;
    font-size: 0.85rem;
    font-weight: 600;                        /* lisää luettavuutta */
    color: #fff;                             /* selkeä valkoinen teksti */
    border: 1px solid rgba(255, 255, 255, 0.35); /* kevyt reunus */
    backdrop-filter: blur(2px);              /* moderni lasimainen efekti */
}

.poniprosentti {
    font-size: 65%;
    vertical-align: text-top;
    margin-left: 4px;
	letter-spacing: 1.5px;
    font-weight: 200;
}
.maa-lippu {
    width: 18px;
    height: auto;
    vertical-align: middle;
    margin-left: 4px;
}

.maa-teksti {
    margin-left: 4px;
    color: #ddd;
    font-size: 0.9rem;
}
.ikaantyminen-box {
    max-width: 500px;          /* sama leveys kuin perustiedoilla */
    margin: 40px auto;
    padding: 20px 25px;
    background: rgba(255,255,255,0.02);  /* kevyempi kuin ennen */
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    backdrop-filter: blur(2px);
}

.ikaantyminen-box h2 {
    text-align: center;
    color: #e0d7c2;
    margin-bottom: 20px;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.ika-grid {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.ika-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ika-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 6px;
    background: rgba(255,255,255,0.03);   /* kevyempi tausta */
    border-radius: 3px;
    color: #ddd;                          /* kevyempi teksti */
    font-size: 0.8rem;                    /* pienempi fontti */
}

.ika-age {
	display: inline-block;
    width: 32px;        /* kiinteä leveys, juuri sopiva 1v–15v */
    font-weight: 500;                     /* ei liian vahva */
    color: #c6a108;                       /* sama kultasävy */
}
.tekstitaulukko {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.tekstitaulukko th,
.tekstitaulukko td {
    border: 1px solid #ccc;
    padding: 6px 10px;
}

.tekstitaulukko th {
    background: #715e0d;
}

.hevonen-luonne {
    max-width: 900px;
    margin: 40px auto;
    padding: 25px 28px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    backdrop-filter: blur(3px);
}

.hevonen-luonne h2 {
    text-align: center;
    color: #e0d7c2;
    margin-bottom: 18px;
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.luonne-teksti {
    color: #e8e8e8;
    line-height: 1.5;
    font-size: 0.9rem;
	letter-spacing: 0.5px;
}

.luonne-teksti p {
    margin-bottom: 0.1em;
}

.luonne-ei {
    text-align: center;
    color: #bbb;
    font-style: italic;
    padding: 10px 0;
}
#sukutaulu {
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    border-collapse: collapse;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    overflow: hidden;
}

#sukutaulu td {
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.05);
    color: #e8e8e8;
	line-height: 1.35;
}
#sukutaulu td span,
#sukutaulu td strong {
    display: inline-block;
    vertical-align: middle;
}

#sukutaulu strong {
    color: #c6a108;
}

#sukutaulu em {
    color: #bbb;
    font-size: 0.9rem;
}
#sukutaulu a {
	color: #c6a108;                 /* kultainen sävy, samaa maailmaa kuin h1 */
    text-decoration: none;          /* ei alleviivausta */
    transition: 2s;    /* pehmeä hover */
}
#sukutaulu a:hover {
	color: #ffcd00; 
	letter-spacing: 0.8px;
	text-shadow: 2px 0 6px rgba(255,205,0,0.4);
}
.meriittilyhenteet {
    color: #d8cfa8;          /* pehmeä, neutraali kultainen */
    font-size: 0.85rem;      /* hieman pienempi ja kevyempi */
    line-height: 1.25;       /* tiiviimpi riviväli */
    padding: 2px 0 2px 0;     /* pienempi väli ylä- ja alapuolella */
    font-weight: 400;        /* kevyempi kuin bold, mutta ei ohut */
    letter-spacing: 0.5px;   /* lisää ilmavuutta */
}
.linjat {
    margin: 25px auto 10px auto;
    max-width: 900px;
    color: #e8e8e8;
    font-size: 0.95rem;
}

.linja-isä b, .linja-emä b {
    color: #e0d7c2;
}

.linja-isä {
    display: block;
    margin-bottom: 6px;
}

.linja-emä {
    display: block;
}
/* Sukuselvitys-laatikko */
.sukuselvitys-box {
    margin: 35px 0;
    padding: 0;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 0 12px rgba(0,0,0,0.15);
    overflow: hidden;
}

/* Summary-otsikko */
.sukuselvitys-box > summary {
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 14px 18px;
    list-style: none;
    color: #f5f5f5;
    position: relative;
}

/* Nuoli summaryn oikeaan reunaan */
.sukuselvitys-box > summary::after {
    content: "▼";
    position: absolute;
    right: 18px;
    transition: transform 0.25s ease;
    opacity: 0.8;
}

/* Käännä nuoli kun auki */
.sukuselvitys-box[open] > summary::after {
    transform: rotate(180deg);
}

/* Sukuselvityksen sisältö */
.sukuselvitys-teksti {
    padding: 18px 22px 25px 22px;
    line-height: 1.6;
    color: #eaeaea;
    animation: fadeIn 0.25s ease;
}

/* Pieni avautumisanimaatio */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.jalke-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.jalke-table th {
    text-align: left;
    padding: 6px 4px;
    border-bottom: 1px solid #444;
    color: #e0d7c2;
}

.jalke-table td {
    padding: 6px 4px;
    border-bottom: 1px solid #333;
}

.jalke-table a {
    color: #d8c9a6;
	text-decoration: none;          /* ei alleviivausta */
    transition: color 0.2s ease;    /* pehmeä hover */
}
.osio {
	color: #e8e8e8;
    line-height: 1.5;
    font-size: 0.9rem;
}
.osio h2 {
    color: #e0d7c2;
    margin-bottom: 10px;
}

.osio p {
    margin: 5px 0;
}
.osio a {
    color: #d8c9a6;
	text-decoration: none;          /* ei alleviivausta */
    transition: color 0.2s ease;    /* pehmeä hover */
}
.osio h4 {
	margin-bottom: 0.5px;
}
.taulukko.kilpailut {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.taulukko.kilpailut th {
    text-align: left;
    padding: 6px 4px;
    border-bottom: 1px solid #444;
    color: #e0d7c2;
}

.taulukko.kilpailut td {
    padding: 6px 4px;
    border-bottom: 1px solid #333;
}
/* Linkit taulukossa */
.taulukko.kilpailut a {
    color: #8ab4ff;
    text-decoration: none;
    font-weight: 500;
}
.cup-otsikko {
    font-family: 'Cinzel', serif;
    color: #c6a108;
    margin-top: 15px;
    letter-spacing: 0.8px;
}

.cup-merkinta {
    display: inline-block;
    background: #b38b59;
    color: #1e1e1e;
    font-size: 11px;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 3px;
    margin-right: 4px;
}
.cup-rivi {
    margin-bottom: 4px;
    line-height: 1.3;
}
.saavutukset {
	font-size: 90%;
	letter-spacing: 0.1px;
}
.saavutukset a {
	color: #d8c9a6;
	text-decoration: none;          /* ei alleviivausta */
    transition: color 0.2s ease;    /* pehmeä hover */
}

.saavutus-rivi {
    margin-bottom: 6px;
    line-height: 1.3;
	letter-spacing: 0.5px;
}

.saavutus-taysi {
    color: #c6a108;
    font-size: 16px;
    margin-right: 4px;
}
.km-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: flex-start;
}

.km-col {
    min-width: 0;
}

/* Kilpailutulosten hallintataulukko */
.taulukko.kilpailuidenhallinta {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

/* Taulukon otsikkorivi */
.taulukko.kilpailuidenhallinta th {
    text-align: left;
    padding: 10px 12px;
    background-color: #2a2a2a;
    color: #f0f0f0;
    font-weight: 600;
    border-bottom: 2px solid #444;
}

/* Taulukon datarivit */
.taulukko.kilpailuidenhallinta td {
    padding: 10px 12px;
    border-bottom: 1px solid #333;
    color: #e0e0e0;
}

/* Hover-efekti riveille */
.taulukko.kilpailuidenhallinta tr:hover td {
    background-color: #2f2f2f;
}

/* Linkit taulukossa */
.taulukko.kilpailuidenhallinta a {
    color: #8ab4ff;
    text-decoration: none;
    font-weight: 500;
}

.taulukko.kilpailuidenhallinta a:hover {
    text-decoration: underline;
    color: #a8c8ff;
}

/* CUP-merkki */
.taulukko.kilpailuidenhallinta td.cup {
    font-weight: bold;
    color: #ffd966;
}
.ilmoitus {
    padding: 10px 14px;
    border-radius: 5px;
    margin: 10px 0 20px 0;
    font-weight: 500;
}

.ilmoitus.onnistui {
    background-color: #1f3d1f;
    border: 1px solid #3f7f3f;
    color: #b6ffb6;
}
.inmemoriam-list {
    list-style: none;
    padding-left: 0;
    margin-top: 20px;
    font-size: 1rem;
    color: #bcaba2;
}

.inmemoriam-list li {
    margin-bottom: 6px;
}

.inmemoriam-list a {
    color: #abae7b;
    font-weight: bold;
    text-decoration: none;
}

.inmemoriam-list a:hover {
    text-decoration: underline;
}
#kokonaiset_polvet {
    display: inline-block;
    width: 80px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    background: #fff;
}
#myBtn {
  display: none;
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 99;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(20, 30, 20, 0.85); /* tumma metsä */
  color: #d8cfa8; /* kultainen */
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0,0,0,0.4);
  transition: 
      background 0.3s ease,
      box-shadow 0.3s ease,
      opacity 0.4s ease;
}

#myBtn:hover {
  background: rgba(40, 60, 40, 0.9);
  box-shadow: 0 0 18px rgba(216,207,168,0.4); /* kultainen hohde */
}
/* --- DETAILS / SUMMARY --- */

details {
    margin: 18px 0;
    border-radius: 6px;
    background: rgba(20, 30, 20, 0.75); /* tumma metsä */
    box-shadow: 0 0 12px rgba(0,0,0,0.4);
    padding: 0;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

details[open] {
    box-shadow: 0 0 18px rgba(216,207,168,0.25); /* kultainen hohde */
}

details summary {
    cursor: pointer;
    padding: 14px 18px;
    font-size: 1.1rem;
    color: #d8cfa8; /* kultainen */
    font-weight: 600;
    letter-spacing: 0.5px;
    background: rgba(30, 45, 30, 0.85);
    user-select: none;
}

details summary:hover {
    background: rgba(40, 60, 40, 0.9);
}

/* --- TABLE --- */

#kasvatittable {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: rgba(255,255,255,0.03);
}

#kasvatittable th {
    text-align: left;
    padding: 10px 12px;
    font-size: 0.95rem;
    color: #e8e3d0;
    background: rgba(30, 45, 30, 0.85);
    letter-spacing: 0.4px;
}

#kasvatittable td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: #f0f0f0;
    font-size: 0.92rem;
}

#kasvatittable tr:hover td {
    background: rgba(255,255,255,0.05);
}

/* --- LINKS --- */

#kasvatittable a {
    color: #d8cfa8; /* kultainen */
    text-decoration: none;
    transition: color 0.2s ease;
}

#kasvatittable a:hover {
    color: #f2e9c0;
}
.hahmo {
    max-width: 100%;
    height: auto;
}

/* --- SMALL TEXT (rekisterinumerot) --- */

#kasvatittable small {
    color: #c7c7c7;
    font-size: 0.8rem;
}
.kilpailudashboard {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.kilpailudashboard th,
.kilpailudashboard td {
    border: 1px solid #ccc;
    padding: 8px 10px;
    text-align: left;
}

.kilpailudashboard th {
    background: #1d401d;
}

.status-varsa {
    color: #888;
    text-decoration: line-through;
}

.taso-valmis {
    background: #ffcd0066;
    font-weight: bold;
}
.tasoform {
    width: 400px;
    border-collapse: collapse;
}

.tasoform th,
.tasoform td {
    border: 1px solid #ccc;
    padding: 8px;
}

.tasoform th {
    background: #1d401d;
}
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    border: none;
    background: #e0e0e0;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 6px;
    transition: 0.2s;
}

.tab-button:hover {
    background: #d0d0d0;
}

.tab-button.active {
    background: #4a90e2;
    color: white;
    font-weight: bold;
}

#tab-content {
    font-size: 1rem;
    line-height: 1.6;
    white-space: pre-wrap; /* tärkeä: rivit pysyvät tekstinä */
}
/* Taso-otsikko */
.taso-title {
    font-size: 1.2rem;      /* hieman isompi */
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 5px;
}
/* --- 950px: korttien leveys --- */
@media (max-width: 950px) {
    .card {
        width: 55%;
        max-width: 350px;
    }
}

/* --- 800px: navigaatio, wrapper, kortit, sukutaulu --- */
@media (max-width: 800px) {
    .topbar {
        flex-direction: column;
        padding: 10px 20px;
    }

    .nav {
        justify-content: center;
        gap: 15px;
    }

    .nav a {
        margin: 10px;
        font-size: 16px;
    }

    .content-wrapper {
        margin: 200px 20px 40px 20px;
        padding: 30px;
    }

    .cards {
        flex-direction: column;
        align-items: center;
        padding: 0 20px;
    }

    .card {
        width: 90%;
    }

    .extended-lines {
        flex-direction: column;
        width: 100%;
        gap: 20px;
    }

    .extended-lines div {
        width: 100%;
    }
}

/* --- 700px: mobiili + isot puhelimet + pienet tabletit --- */
@media (max-width: 700px) {

    /* Fonttikoot pienemmiksi */
    .hevonen-luonne,
    .luonne-teksti,
    #sukutaulu,
    #sukutaulu em,
    .meriittilyhenteet,
    .perustiedot,
    .genotype-box,
    .osio,
    .taulukko.kilpailut,
	.accordion-label,
	.linjat,
	.jalke-table,
	p, h2, h3, h4 {
        font-size: 75%;
		letter-spacing: 0.4px;
    }
	.hevonen-nimi {
    font-size: x-large;
    letter-spacing: 1px;
	}

    /* Meriittirivi erikseen (koska eri fonttikoko) */
    .meriitti-rivi {
        font-size: 1rem;
        letter-spacing: 0.5px;
    }

    /* Labelit joustaviksi */
    .label {
        margin-right: 0;
        min-width: auto;
        font-weight: 500;
    }
	.ikaantyminen-box {
		max-width: 250px;
	}
    /* Ikägridi pinoutuu */
    .ika-grid {
        flex-direction: column;
        gap: 12px;
    }
	.ika-item {
		font-size: 75%;
	}

    /* Kortit */
    .card {
        width: 100%;
        max-width: 350px;
    }

    .card img {
        max-width: 100px;
        height: 110px;
        object-fit: contain;
    }
	.card p {
		font-size: 75%;
	}
	.card strong {
		font-size: 80%;
	}
	.cup-merkinta {
		font-size: 75%;
	}
    /* Footer */
    .footer {
        flex-direction: column;
        text-align: center;
        gap: 5px;
        font-size: 13px;
        padding: 15px 5px;
    }

    .footer-right a {
        margin: 0 4px;
    }

    /* Koristeviiva */
    .decorative-divider {
        margin-top: 140px;
        margin-bottom: 0;
    }
	#kasvatittable th,
    #kasvatittable td, 
	#kasvatittable a {
        padding: 6px 8px;
        font-size: 0.45rem;
    }

    details summary {
        font-size: 1rem;
        padding: 12px 14px;
    }
	/* mobiili/taulukko wrapper */
	.kasvatit-scroll-container {
	  position: relative;
	}

	/* wrapper joka scrollaa */
	.kasvatit-wrapper {
	  overflow-x: auto;
	  -webkit-overflow-scrolling: touch;
	}

	/* varjoelementti — kiinteä containerin oikeassa reunassa */
	.scroll-shadow-right {
	  position: absolute;
	  top: 0;
	  right: 0;
	  width: 36px; /* varjon leveys */
	  height: 100%;
	  pointer-events: none;
	  background: linear-gradient(to right, rgba(0,0,0,0), rgba(20,30,20,0.85));
	  opacity: 0;
	  transition: opacity 220ms ease;
	  z-index: 5;
	}

	/* näkyvä tila */
	.scroll-shadow-right.visible {
	  opacity: 1;
	}

	/* estä varjon peittämästä sisältöä: lisää pieni oikea padding wrapperiin */
	.kasvatit-wrapper {
	  padding-right: 6px; /* pieni sisennys, ei vaikuta scrollWidth merkittävästi */
	}

	/* taulukon min-width pitää sen vieritettävänä mobiilissa */
	#kasvatittable {
	  min-width: 600px;
	}

	#kasvatittable {
        min-width: 500px; /* estää taulukkoa menemästä liian pieneksi */
    }
	.hahmo {
        width: 60%;   /* pienempi mobiilissa */
        max-width: 350px; /* yläraja */
        height: auto;
        display: block;
        margin: 0 auto; /* keskitys */
    }
}
