html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--app-bg);
  user-select: none;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  color: var(--text-strong);
}

.mypage_header{
  position: sticky;
  top: 0;
  z-index: 10;

  height: 56px;
  box-sizing: border-box;
  padding: 0 4px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  background: var(--app-bg);
}

.mypage_back{
  display: flex;
  align-items: center;

  color: var(--text-secondary);
  text-decoration: none;
  font-size: 18px;
}

.back_icon {
  font-size: 24px;
  line-height: 1;
  margin-right: -4px;
  position: relative;
  top: 1px;
  left: -4px;
}

.mypage_header_logo{
  display: flex;
  align-items: center;

  font-family: 'Atkinson Hyperlegible Mono', monospace;
  font-size: 23px;
  font-weight: 500;
  letter-spacing: 0.5px;
  line-height: 1;

  color: var(--text-main);
  text-decoration: none;
}

.mypage{
  border-radius: 5px;
  margin: 0 auto;
  width: 420px;
  background: var(--panel-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.login{
  border-radius: 5px;
  margin: 0 auto;
  width: 420px;
  background: var(--panel-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  margin-top: 30px;
}

.green {
  color: #2e8b57;
}

.game_start:hover{
  opacity: .8;
}
.game_register:hover {
  opacity: .8;
}

.game_start{
  width: 200px;
  height: 34px;
  font-size: 14px;
  border-radius: 5px;
  color: #fff;
  cursor: pointer;
  display: block;

  background: var(--action-blue);
  text-decoration: none;
  text-align: center;
  line-height: 34px;
}

.inf{
  padding: 20px 50px 30px;
}

.com{
  color: red;
  font-size: 14px;
  margin: 8px 0 0;

  position: relative;
  top: -22px;
}

.name{
  margin: 0;
  text-align: center;
}

.user {
  margin: 0 auto;
  padding: 0 40px 20px 40px;
}

.user input[type='text'],
.user input[type='password'] {
  font-family: inherit;
  font-size: 14px;
  line-height: 24px;

  box-sizing: border-box;
  width: 100%;
  height: 40px;
  padding: 0.3em 0.3em 0.3em 0.7em;
  transition: border-color 0.3s;
  letter-spacing: 0.5px;
  background: var(--surface-bg);
  color: var(--field-text);
  border: 1px solid var(--border-default);
  border-radius: 4px;
}

.ef input[type='text']:focus,
.ef input[type="password"]:focus,
.e input[type='text']:focus,
.e input[type="password"]:focus {
	border: 1px solid var(--action-blue);
	outline: none;
	box-shadow: 0 0 1px 1px var(--action-blue);
}

.game_login,
.game_register{
  border:none;
  margin-top: 10px;
  width: 100%;
  height: 40px;
  font-size: 14px;
  border-radius: 5px;
  color: #fff;
  cursor: pointer;
  display: block;
}

.game_register{
  background: var(--sub-blue);
}

.aa{
  text-align: center;
  margin: 0;
  padding: 16px 0;
  font-size: 15px;
}

.environment_card > .aa {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.aaa{
  margin: 8px 0;
}

.login_pass_toggle{
  display: none;
}

.login_pass_label{
  position: relative;
  top: -30px;
  left: 91%;
}

.Description p{
  margin: 0;
  padding: 0;
  line-height: 26px;
}

.Description {
  padding: 5px ;
  margin-top: 15px;
  text-align: center;
}

.coment{
  color: red;
  margin: 6px 0 0;
  white-space: pre-line;
}

/* サーバー接続中モーダル */

.common_modal {
  position: fixed;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: 300px;
  height: 150px;
  box-sizing: border-box;
  padding: 18px 12px;

  background: var(--modal-bg-translucent);
  color: var(--modal-accent);

  border-radius: 6px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .26);

  text-align: center;
  z-index: 99999;
}

.server_wait_modal_non{
  display: none;
}

.modal_lock::before {
  content: "";
  position: fixed;
  inset: 0;

  background: transparent;
  z-index: 99998;
}

.msg_finish {
  margin: 0;
  padding: 25px 0;
  font-size: 18px;
  text-align: center;
  color: inherit;
}

.loading_icon {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;

  height: 10px;
  margin: 0;
}

.loading_dot{
  display: block;
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--modal-accent);

  opacity: .4;
  transform: scale(.5);

  animation: loading_dot 1.8s infinite ease-in-out;
  animation-fill-mode: both;
}

.loading_dot:nth-child(2){
  animation-delay: .2s;
}

.loading_dot:nth-child(3){
  animation-delay: .4s;
}

@keyframes loading_dot{
  0%, 80%, 100%{
    transform: scale(.5);
    opacity: .4;
  }

  40%{
    transform: scale(1.2);
    opacity: 1;
  }
}

.mypage_top{
  width: 420px;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
}

.mypage_name{
  margin: 30px auto 14px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.mypage_start_btn{
  width: 220px;
  height: 48px;
  line-height: 48px;
  margin: 30px auto;
}

.restore_card{
  margin-top: 0;
}

.restore_code_page .restore_card{
  margin-top: 86px;
}

.restore_page_notes{
  margin: 30px auto 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.restore_page_notes p{
  margin: 0;
}

.restore_page_notes p + p{
  margin-top: 4px;
}

.restore_area{
  padding-top: 0;
}

.restore_code_box{
  padding: 14px 0 0;
  border: none;
  background: transparent;
}

.restore_code_box .aaa{
  margin: 0 0 10px;
  text-align: center;
  font-size: 15px;
}

.restore_code_wrap{
  display: block;
}

.restore_code{
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border-radius: 5px;
  background: var(--surface-bg);
  border: 1px solid var(--border-default);
  color: var(--field-text);
  font-family: 'Atkinson Hyperlegible Mono', monospace;
  font-size: 15px;
  letter-spacing: .5px;
  user-select: none;
  word-break: break-all;
  padding: 0.3em;
  line-height: 24px;
}

.restore_code_actions{
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.restore_code_icon_btn,
.restore_code_copy_btn{
  height: 40px;
  border: none;
  border-radius: 5px;
  background: var(--sub-blue);
  color: #fff;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .restore_code_icon_btn:hover,
  .restore_code_copy_btn:hover{
    opacity: .8;
  }
}

.restore_code_icon_btn:active,
.restore_code_copy_btn:active{
  opacity: .75;
}

.restore_code_icon_btn{
  width: 48px;
}

.restore_code_copy_btn{
  flex: 1;
  font-size: 13px;
}

.restore_code_icon_btn .material-icons{
  font-size: 21px;
  line-height: 40px;
}

.restore_code_note{
  margin: 15px 0 10px;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.logout_link_form{
  text-align: center;
  margin: 24px 0 26px;
}

.logout_link{
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
}

.logout_link:hover{
  color: var(--text-strong);
  text-decoration: underline;
}

.environment_card {
  width: 420px;
  margin: 30px auto 0;
  border-radius: 5px;
  background: var(--panel-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.environment_settings {
  padding: 0 40px 20px;
}

.environment_group_title {
  margin: 24px 0 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-default);
  font-size: 14px;
  font-weight: 600;
}

.environment_group_title:first-child {
  margin-top: 0;
}

/* 環境設定の横並び操作UI */
.environment_card .setting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 0;
}

.environment_card .setting + .setting {
  padding-top: 28px;
}

.environment_card .setting_menu {
  margin: 0;
  font-size: 16px;
}

.environment_card .setting input[type="radio"] {
  display: none;
}

.environment_card .setting_switch {
  display: flex;
  flex-shrink: 0;
  justify-content: center;

  background: var(--control-bg);
  border: none;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--control-border);
}

.environment_card .setting_btn {
  display: flex;
  justify-content: center;
  align-items: center;

  width: 54px;
  height: 28px;
  padding: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1;
  font-weight: 400;

  box-shadow: inset 0 1px 1px rgba(0,0,0,.04);
  background: transparent;
  color: var(--text-muted);

  cursor: pointer;
  user-select: none;
  transition: .2s;
}

.environment_card .setting_btn:first-of-type {
  border-radius: 4px 0 0 4px;
}

.environment_card .setting input[type="radio"]:checked + .setting_btn {
  background: var(--sub-blue);
  color: #fff;
  box-shadow: none;
}

.environment_card .setting_desc {
  padding: 0 20px;
  margin-top: 8px;

  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.environment_note {
  margin: 8px 0 0;
  padding: 0 20px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  text-align: left;
}

.account_section_title {
  box-sizing: border-box;
  width: 420px;
  max-width: 100%;
  margin: 30px auto 0;
  padding: 16px 0 0;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

@media screen and (max-width: 600px) {
  html,
  body {
    width: 100%;
    min-width: 360px;
    overflow-x: clip;
  }

  .mypage_header::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -12px;
    right: -12px;
    background: var(--app-bg);
    z-index: -1;
    pointer-events: none;
  }

  body {
    box-sizing: border-box;
    padding: 0 8px;
  }

  .mypage,
  .login,
  .environment_card,
  .mypage_top {
    width: 360px;
    max-width: 100%;
  }

  .user {
    padding: 0 24px 20px;
  }

  .environment_settings {
    padding: 0 24px 20px;
  }

}

@media screen and (min-width: 601px) {
  .mypage_header {
    width: 420px;
    margin: 0 auto;
    padding: 0 10px;
  }

  .mypage_header::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -12px;
    right: -12px;
    background: var(--app-bg);
    z-index: -1;
    pointer-events: none;
  }
}

@media screen and (min-width: 601px) and (hover: hover) and (pointer: fine) {
  .mypage_back:hover,
  .mypage_header_logo:hover {
    opacity: 0.65;
  }
}

/* ヘッダーリンクの押下フィードバック */
.mypage_back,
.mypage_header_logo {
  -webkit-tap-highlight-color: transparent;
  transition: opacity .1s ease-out .1s;
}

.mypage_back:active,
.mypage_header_logo:active {
  opacity: .55;
  transition: none;
}
