#content {
  flex: 1;
}
footer a {
  text-decoration:underline;
  color:#333;
}
footer {
  text-align:center;
  font-size:80%;
  border-top: 1px solid #eee;
  padding-top:10px;
  padding-bottom:10px;
  margin:0 40px 0 40px;
}
#screen_start {
  padding-top:60px;
  font-size: 14px;
}
html {
   overflow-y: scroll;
}
/* ── Навигация ── */
#site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 10px;
    background: #111;
    color: #fff;
}
#nav-logo {
    font-weight: bold;
    font-size: 16px;
    color: #fff;
    text-decoration: none;
    letter-spacing: 1px;
}
#nav-right { display: flex; align-items: center; gap: 10px; }
.nav-link {
    color: #aaa;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}
.nav-link:hover { color: #fff; }
.nav-login {
    background: #fff;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
}
.nav-login:hover { background: #4448cc; color: #fff; }
.nav-logout { color: #888; }

/* ── Авторизация ── */
.auth-wrap {
    max-width: 400px;
    margin: 60px auto;
    padding: 0 20px;
}
.auth-wrap h2 { margin-bottom: 20px; font-size: 22px; }
.auth-error {
    background: #fff0f0;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.auth-tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid #eee; }
.auth-tab {
    background: none;
    border: none;
    padding: 8px 20px;
    font-size: 15px;
    cursor: pointer;
    color: #888;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.auth-tab-active { color: #595dff; border-bottom-color: #595dff; font-weight: bold; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-input {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.auth-input:focus { border-color: #595dff; }
.auth-input:disabled { background: #f5f5f5; color: #999; }
.auth-btn {
    padding: 11px;
    background: #595dff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    font-family: inherit;
    margin-top: 4px;
}
.auth-btn:hover { background: #4448cc; }
.auth-divider {
    text-align: center;
    color: #aaa;
    margin: 20px 0 12px;
    font-size: 13px;
    position: relative;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 44%;
    height: 1px;
    background: #ddd;
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }
.auth-oauth { display: flex; flex-direction: column; gap: 10px; }
.oauth-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    transition: opacity 0.2s;
}
.oauth-btn:hover { opacity: 0.85; }
.oauth-google { background: #fff; color: #333; border: 1px solid #ddd; }
.oauth-vk     { background: #0077ff; color: #fff; }

/* ── Личный кабинет ── */
.profile-wrap {
    max-width: 700px;
    margin: 40px auto;
    padding: 0 20px 60px;
}
.profile-wrap h2 { font-size: 22px; margin-bottom: 20px; }
.profile-wrap h3 { font-size: 18px; margin-top: 0; margin-bottom: 14px; }
.profile-form { display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.profile-label { font-size: 13px; color: #555; margin-bottom: -4px; }
.profile-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 4px;
}
.profile-checkbox input { margin-top: 3px; cursor: pointer; flex-shrink: 0; }
.profile-analysis {
    background: #f0f4ff;
    border: 1px solid #c5d0ff;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.6;
}
.games-table-wrap { overflow-x: auto; }
.games-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.games-table th {
    background: #f5f5f5;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}
.games-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}
.games-table tr:hover td { background: #fafafa; }

@keyframes flipIn {
    0%   { transform: rotateY(90deg); opacity: 0; }
    100% { transform: rotateY(0deg);  opacity: 1; }
}

@keyframes flipOut {
    0%   { transform: rotateY(0deg); opacity: 1; }
    100% { transform: rotateY(90deg);  opacity: 0; }
}

.gbukva {
    animation: flipIn 0.4s ease forwards;
    opacity: 0;
    user-select: none;
}



@font-face {
    font-family: 'PT Sans';
    font-style: italic;
    font-weight: 400;
    src: url(https://fonts.gstatic.com/s/ptsans/v18/jizYRExUiTo99u79D0e0ysmIEDQ.woff2) format('woff2');
    unicode-range: U +0460 -052F, U +1C80 -1C8A, U +20B4, U +2DE0 -2DFF, U + A640-A69F, U + FE2E-FE2F;
}
body {
    font-family: "PT Sans", sans-serif;
    margin:0;
    padding-bottom: 0;
    
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

#multi { 
    font-size: 20px;
    padding: 12px 32px;
    cursor: pointer;
    background: #595dff;
    color: #fff;
    border: none;
    border-radius: 6px;
    margin-top: 100px;
    
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translate(-50%);
}
#multi:hover {
    background: #4448cc;
}

 /* Режим выбора */
#mode_selector { text-align: center; padding: 40px 20px; }
#mode_selector h1 { margin-bottom: 30px; }
#mode_selector button {
  font-size: 18px;
  padding: 15px 40px;
  margin: 0 10px;
  cursor: pointer;
  background: #595dff;
  color: #fff;
  border: none;
  border-radius: 6px;
}
#mode_selector button:hover { background: #4448cc; }

/* Одиночная игра */
#single_mode { display: none; }
#single_game_tab { display: none; margin-top: 0; background: #ebebeb; padding: 4px 8px 0 4px; }
#single_game_tab > div { padding: 4px 0; }
#single_mode .back_button {
  display: block;
  margin-top: 20px;
  text-align: center;
}
#single_mode .back_button button {
  background: #666;
  padding: 10px 20px;
  font-size: 14px;
  color:#fff;
}
#single_mode .back_button button:hover {
  background: #555;
}

/* Мультиплеер */
#multi_mode { display: none; }
#multi_wrap { max-width: 800px; margin: 0 auto; text-align: center; }
#multi_scores { display: flex; align-items: center; gap: 6px;
                background: #111; padding: 8px 10px; margin-bottom: 10px;
                border-radius: 4px; }
#opp_word_wrap { background: #fff; padding: 4px 10px; margin-bottom: 8px;
                font-size: 13px; color: #888; text-align: right;
                border-radius: 4px; letter-spacing: 1px; }
#opp_word_display { font-family: monospace; font-size: 15px; }
.opp-revealed { color: #49bd49; font-weight: bold; }
.opp-wrong { color: #e33; font-weight: bold; }
.mk-side { display: flex; align-items: center; gap: 5px; flex: 1; min-width: 0; }
.mk-left { flex-direction: row; }
.mk-right { flex-direction: row; }
.mk-name { font-size: 10px; font-weight: bold; color: #aaa;
          white-space: nowrap; text-transform: uppercase; letter-spacing: 1px;
          transition: color 0.3s ease, text-shadow 0.3s ease; }
.mk-name-done { color: #49bd49;
                text-shadow: 0 0 8px rgba(73, 189, 73, 0.7); }
.mk-num { font-size: 13px; font-weight: bold; color: #fff;
         min-width: 26px; text-align: center; flex-shrink: 0; }
.mk-track { flex: 1; height: 18px; background: #2a2a2a;
           border: 1px solid #444; border-radius: 2px;
           position: relative; overflow: hidden; }
.mk-bar { position: absolute; top: 0; height: 100%;
         width: 0%; transition: width 0.25s ease, background 0.4s ease; }
.mk-bar-left { left: 0; }
.mk-bar-right { right: 0; }
#vs_label { font-size: 15px; font-weight: bold; color: #ffcc00;
           padding: 0 4px; flex-shrink: 0; }
#multi_wait { padding: 40px 0; font-size: 20px; color: #555; }
.spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid #ccc;
          border-top-color: #595dff; border-radius: 50%;
          animation: spin 0.8s linear infinite; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
#word_done_overlay { background: rgba(255,255,255,0.9); padding: 20px;
                    font-size: 20px; color: #555; margin-top: 10px; }
#multi_over { padding: 40px 20px; }
#multi_over h2 { font-size: 32px; margin-bottom: 10px; }
.won { color: #49bd49; }
.lost { color: #e33; }
#btn_join { font-size: 20px; padding: 12px 32px; cursor: pointer;
           background: #595dff; color: #fff; border: none; border-radius: 6px; margin-top: 20px; }
#btn_join:hover { background: #4448cc; }
#btn_rematch { font-size: 16px; padding: 10px 24px; cursor: pointer; margin-top: 16px;
              background: #595dff; color: #fff; border: none; border-radius: 6px; }
#btn_rematch:hover { background: #4448cc; }
#multi_mode .back_button {
  text-align: center;
  margin-top: 20px;
}
#multi_mode .back_button button {
  background: #666;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  color: #fff;
}
#multi_mode .back_button button:hover {
  background: #555;
}

/* ── Стартовый экран ── */
#start-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    
    padding: 60px 20px 20px;
    box-sizing: border-box;
}
#start-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 360px;
    width: 100%;
    text-align: center;
}
.start-tagline {
    font-size: 14px;
    color: #555;
    margin: 0 0 4px;
    line-height: 1.5;
}
.start-btn {
    padding: 14px 60px;
    background: #595dff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
}
.start-btn:hover { background: #4448cc; }
.start-btn-ghost {
    padding: 11px;
    background: none;
    color: #595dff;
    border: 1px solid #595dff;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
}
.start-btn-ghost:hover { background: #f0f0ff; }
.start-leaderboard {
    font-size: 13px;
    color: #aaa;
    text-decoration: none;
    margin-top: 4px;
}
.start-leaderboard:hover { color: #595dff; }

/* ── Таблица лидеров ── */
.leaderboard-wrap {
    max-width: 860px;
    margin: 40px auto;
    padding: 0 20px 60px;
}
.leaderboard-wrap h2 { font-size: 22px; margin-bottom: 20px; }
.lb-first td  { background: #fffbe6; }
.lb-second td { background: #f5f5f5; }
.lb-third td  { background: #fff4ee; }

/* ── О проекте ── */
#about {
    max-width: 800px;
    margin: 0 auto 0;
    padding: 20px 20px 20px;
}
#about h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #222;
    text-align: center;
}
#about-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.about-card {
    display: flex;
    gap: 14px;
    background: #f7f8ff;
    border: 1px solid #e0e3ff;
    border-radius: 10px;
    padding: 16px;
}
.about-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}
.about-text b {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
    color: #222;
}
.about-text p {
    margin: 0;
    font-size: 13px;
    color: #555;
    line-height: 1.55;
}
@media (max-width: 600px) {
    #about-cards { grid-template-columns: 1fr; }
    #about h2 { font-size: 17px; }
}

textarea::placeholder { color: #fff; }
textarea {
    height: 33px;
}
.progrbar {
    color:#eee;
    transition:0.2s linear;
    display:none;
    position:absolute;
}
.playAnswerButton{
    cursor:pointer;
    float:left;
    width:130px;
}

#game {
    text-align: center;
    margin: 60px 0 200px 0;
    padding: 0 20px;
}
#gslovo {
    font-size: 60px;
    filter: drop-shadow(0px 1px 1px #000);
    color: #595dff;
    margin-bottom: 80px;
    font-weight: 700;
}
#gbukvi {
    display:flex;
    justify-content: center;
    gap:10px;
    position: absolute;
    top: 360px;
    left: 0;
    right: 0;
}
.gbukva {
    border-radius: 10px;
    font-size: 50px;
    display: inline-block;
    color: #444;
    border: 1px solid #CCC;
    background: #DDD;
    padding: 10px;
    cursor: pointer;
    box-shadow: 0 0 5px -1px rgba(0, 0, 0, 0.2);
}
.gbukva:hover {
    color: blue;
    background: #fff;
}
.gbukva:active {
    box-shadow: 0 0 5px -1px rgba(0, 0, 0, 0.6);
}

@media (min-width: 768px) {
    #about {
      padding-top:60px;
    }
    #site-nav {
      justify-content: center;
      gap: 20px;
  }
  #single_game_tab {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}
@media (max-width: 767px) {
    #single_game_tab {
      display: flex;
      align-items: center;
      flex-direction: column;
    }
}

