 #       body { font-family: Arial, sans-serif; max-width: 800px; margin: 0 auto; padding: 20px; }
        h1 { color: #0057b7; }
        .info-block { margin-bottom: 15px; }
        .country-block{
            background-color: #dedede;
            box-sizing: border-box;
            flex: 1 1 200px;
            margin: 5px;
            padding: 20px;
            border: 1px solid #ccc;
            border-radius: 4px;
            background: #fafafa;}
        .price { font-weight: bold; color: #28a745; }
        .author { font-weight: bold;  }
        .back-link { display: inline-block; margin-top: 20px; }

        /* Стилі для модального вікна */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
        }
        .modal-content {
            background-color: #fefefe;
            margin: 10% auto;
            padding: 20px;
            border: 1px solid #888;
            width: 80%;
            max-width: 500px;
            border-radius: 5px;
        }
        .close {
            color: #aaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
        }
        .form-group {
            margin-bottom: 15px;
        }
        label {
            display: block;
            margin-bottom: 5px;
        }
        input[type="text"],
        input[type="email"],
        input[type="number"] {
            width: 100%;
            padding: 8px;
            box-sizing: border-box;
        }
        .error {
            color: red;
            margin-bottom: 10px;
        }
        .success {
            color: green;
            margin-bottom: 10px;
        }



.payment-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.payment-option input[type="radio"] {
    margin: 0;
}


      #refreshButton {
            background-color: #4CAF50; /* Зелений колір */
            color: white;
            border: none;
            padding: 10px 20px;
            text-align: center;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            font-size: 16px;
            margin: 10px 0;
            cursor: pointer;
            border-radius: 8px;
            transition: all 0.3s ease;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        }

        #refreshButton:hover {
            background-color: #45a049; /* Темніший зелений при наведенні */
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }

        #refreshButton:active {
            transform: translateY(0);
            box-shadow: 0 2px 3px rgba(0,0,0,0.2);
        }

        #refreshButton svg {
            transition: transform 0.5s ease;
        }

        #refreshButton:hover svg {
            transform: rotate(360deg);
        }

 



.country-page { min-height: 90vh; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 14px; }

.topbar{
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 14px;
  display:flex;
  gap:12px;
  align-items:center;
  justify-content: space-between;
}

.brand{ font-weight: 800; text-decoration:none; color:#111; }
.topnav{ display:flex; gap:12px; }
.topnav a{ text-decoration:none; color: rgba(0,0,0,.75); font-weight:600; font-size:13px; }
.topnav a:hover{ text-decoration: underline; color:#111; }
.backlink{ text-decoration:none; color: rgba(0,0,0,.65); font-size:13px; }

.card{
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  padding: 14px;
}

.country-hero .hero-card{ padding: 16px; }

.hero-head{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 14px;
}

.hero-title{ display:flex; gap:12px; align-items:center; }
.hero-flag{ width:48px; border-radius:8px; box-shadow:0 0 3px rgba(0,0,0,.15); }
.hero-title h1{ margin:0; font-size: 22px; letter-spacing: .2px; }

.badge{
  margin-top: 6px;
  display:inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge.owned{ background: rgba(0,0,0,.06); color: rgba(0,0,0,.75); }
.badge.free{ background: rgba(46,125,50,.12); color: #2e7d32; }

.hero-side{
  display:flex;
  align-items:flex-start;
  justify-content:flex-end;
  gap: 14px;
  flex: 0 1 52%;
  min-width: 0;
}

.hero-price{
  text-align:right;
  min-width: 180px;
  flex: 0 0 180px;
}
.price .label{ font-size: 12px; color: rgba(0,0,0,.6); }
.price .value{ font-size: 26px; font-weight: 800; margin-top: 2px; }
.meta{ margin-top: 6px; font-size: 12px; color: rgba(0,0,0,.65); display:grid; gap:4px; }
.meta .k{ opacity:.85; }
.meta .v{ font-weight:700; color: rgba(0,0,0,.78); margin-left:6px; }

.promo-pin{
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;

  background:
    linear-gradient(0deg,
      rgba(46,125,50,0.06),
      rgba(46,125,50,0.06)
    ),
    rgba(255,255,255,.9);

  border: 1px solid rgba(46,125,50,.25);
  border-left: 4px solid #2e7d32;

  box-shadow:
    0 6px 16px rgba(0,0,0,.05),
    inset 0 1px 0 rgba(255,255,255,.6);
}

.pin-label{
  font-size: 12px;
  font-weight: 800;
  color: rgba(46,125,50,.9);
  display:flex;
  align-items:center;
  gap:6px;
}

.pin-label::before{
  content: "📌";
  font-size: 14px;
}

.pin-text{
  font-size: 15px;
  font-weight: 900;
  margin-top: 6px;
}

.pin-link{
  display:inline-block;
  margin-top: 6px;
  font-weight: 800;
  color: #1b5e20;
  text-decoration: none;
}

.pin-link:hover{
  text-decoration: underline;
}


.hero-actions{
  margin-top: 30px;
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  align-items:center;
}
.btn{
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 800;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.9);
  cursor:pointer;
}
.btn.primary{ background: #111; color: #fff; border-color:#111; }
.btn.primary:hover{ filter: brightness(1.05); }
.btn.ghost:hover{ background: rgba(0,0,0,.04); }

.hint{ font-size: 12px; color: rgba(0,0,0,.6); font-weight:600; }

.country-grid{
  margin-top: 12px;
  display:grid;
  grid-template-columns: 1.2fr .8fr .8fr;
  gap: 12px;
}

.card-title{ font-weight: 900; margin-bottom: 10px; }
.bullets{ margin:0; padding-left: 18px; color: rgba(0,0,0,.75); font-weight:600; font-size:13px; }
.bullets li{ margin: 6px 0; }

.facts{ display:grid; gap:8px; font-size:13px; }
.facts .k{ color: rgba(0,0,0,.6); font-weight:700; }
.facts .v{ font-weight: 900; color: rgba(0,0,0,.8); float:right; }

.social-row{ display:flex; gap:8px; flex-wrap:wrap; }
.social-btn{
  width: 36px; height: 36px;
  border-radius: 12px;
  display:inline-flex; align-items:center; justify-content:center;
  border: 1px solid rgba(0,0,0,.1);
  background: rgba(255,255,255,.9);
  text-decoration:none;
  color: rgba(0,0,0,.75);
  font-weight: 900;
}
.social-btn:hover{ transform: translateY(-1px); }

@media (max-width: 860px){
  .hero-head{ flex-direction: column; text-align:left; }
/*  .hero-side{
    width: 100%;
    flex-direction: column;
    justify-content: flex-start;
  }
*/
  .hero-price{
    text-align:left;
    min-width:auto;
    flex: 1 1 auto;
  }
  .country-map-card.compact{
    width: 100%;
    max-width: 100%;
    margin-left: 0;
  }
  .country-grid{ grid-template-columns: 1fr; }
  .topnav{ display:none; } /* або зробити компактний бургер як на головній */
}


/* --- Purchase history (accordion) --- */
.country-history{ margin-top: 12px; }

.history-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}

.btn-sm{ padding: 8px 12px; font-size: 12px; }

.history-empty{
  font-size: 13px;
  color: rgba(0,0,0,.65);
  font-weight: 600;
  padding: 6px 0;
}

.history-list{ display:grid; gap: 8px; margin-top: 10px; }

.history-item{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  background: rgba(0,0,0,.03);
  overflow: hidden;
}

.history-item.highlight{
  background: rgba(46,125,50,.10);
  border-color: rgba(0,0,0,.18);
}

.history-summary{
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  display:grid;
  grid-template-columns: 90px 90px 1fr;
  gap: 10px;
  align-items:center;
  font-weight: 800;
  color: rgba(0,0,0,.78);
}

.history-item summary::-webkit-details-marker{ display:none; }

.hs-price{ font-weight: 900; }
.hs-date{ font-weight: 800; color: rgba(0,0,0,.60); font-size: 12px; }
.hs-buyer{ font-weight: 800; font-size: 13px; }

.history-body{
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(0,0,0,.06);
  font-size: 12px;
  color: rgba(0,0,0,.70);
  display:grid;
  gap: 6px;
}

.history-extra{ display:none; }

@media (max-width: 700px){
  .history-summary{
    grid-template-columns: 80px 80px 1fr;
  }
}

.pin-sub{
  font-size: 11px;
  font-weight: 700;
  color: rgba(0,0,0,.55);
  margin-top: 2px;
margin-bottom:15px;
}


.country-map-card {
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.country-map-card.compact{
    width: min(100%, 520px);
    flex: 1 1 340px;
    margin: 0 0 0 auto;
    align-self: stretch;
}

.country-map-head{
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.country-map-head h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
    color: #1f2937;
}

.country-map-svg-wrap {
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    padding: 0;
    position: relative;
}

.country-map-svg-wrap svg {
    width: 100%;
    height: 100%;
    display: block;
}

.country-map-svg-wrap path,
.country-map-svg-wrap polygon,
.country-map-svg-wrap circle,
.country-map-svg-wrap ellipse {
    fill: #d6dbe1;
    stroke: #ffffff;
    stroke-width: 0.8;
    transition: fill 0.25s ease, opacity 0.25s ease;
    vector-effect: non-scaling-stroke;
}

.country-map-svg-wrap .active-country {
    fill: #ff5a3c;
    stroke: #b42318;
    stroke-width: 1.2;
}

.country-map-svg-wrap.dimmed path,
.country-map-svg-wrap.dimmed polygon,
.country-map-svg-wrap.dimmed circle,
.country-map-svg-wrap.dimmed ellipse {
    opacity: 0.30;
}

.country-map-svg-wrap.dimmed .active-country {
    opacity: 1;
}

.country-map-note {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

 .hero-wrap {
     display: flex;
     gap: 30px;
     align-items: stretch;
 }

 .hero-left {
     flex: 1 1 55%;
     display: flex;
     flex-direction: column;
     gap: 18px;
     min-width: 0;
 }

 .hero-top {
     display: flex;
     justify-content: space-between;
     align-items: flex-start;
     gap: 20px;
 }

 .hero-title {
     display: flex;
     gap: 12px;
     align-items: center;
     min-width: 0;
 }

 .hero-price {
     text-align: right;
     min-width: 180px;
     flex: 0 0 180px;
 }

 

 .promo-pin {
     margin-top: 0;
 }


 

/* =========================
   MOBILE: Country page
========================= */
@media (max-width: 860px) {
 .country-hero .hero-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
  }

  .country-hero .hero-left {
    order: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 0 0 auto;
  }

  .country-hero .hero-side {
    order: 2;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 0 0 auto;

    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    overflow: hidden;
    border-radius: 16px;
  }

  .country-hero .hero-top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .country-hero .hero-title {
    width: 100%;
    min-width: 0;
  }

  .country-hero .hero-price {
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    text-align: left;
  }

  .country-hero .country-map-card,
  .country-hero .country-map-card.compact {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    margin-left: 0;
    align-self: stretch;
  }

  .country-hero .country-map-svg-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .country-hero .country-map-svg-wrap svg {
    width: 100%;
    max-width: 100%;
    height: 100%;
    display: block;
  }
}
