.gafreak-article-card-link,
.gafreak-article-keyword-link,
.gafreak-card-editor-link,
.gafreak-card-editor-image-link{
  text-decoration-line:underline;
  text-decoration-style:dotted;
  text-decoration-thickness:1px;
  text-underline-offset:.16em;
  cursor:pointer;
}

.gafreak-acal-modal[hidden]{
  display:none!important;
}

.gafreak-acal-modal{
  position:fixed;
  inset:0;
  z-index:2147483000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.gafreak-acal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.72);
  backdrop-filter:blur(4px);
}

.gafreak-acal-panel{
  position:relative;
  z-index:1;
  width:min(920px,100%);
  max-height:min(86vh,900px);
  overflow:auto;
  border-radius:16px;
  background:#11151b;
  color:#f5f7fa;
  box-shadow:0 24px 80px rgba(0,0,0,.48);
  overscroll-behavior:contain;
}

.gafreak-acal-close{
  position:sticky;
  top:10px;
  float:right;
  z-index:4;
  width:42px;
  height:42px;
  margin:10px 10px -52px 0;
  border:1px solid rgba(255,255,255,.18);
  border-radius:50%;
  background:rgba(10,12,16,.88);
  color:#fff;
  font-size:28px;
  line-height:1;
  cursor:pointer;
}

.gafreak-acal-body{
  min-height:180px;
  padding:24px;
}

.gafreak-acal-loading{
  min-height:170px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  text-align:center;
}

.gafreak-acal-error{
  min-height:170px;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  justify-content:center;
  gap:16px;
  text-align:center;
}

.gafreak-acal-error-message{
  font-size:16px;
}

.gafreak-acal-spinner{
  width:20px;
  height:20px;
  border:2px solid rgba(255,255,255,.22);
  border-top-color:#fff;
  border-radius:50%;
  animation:gafreak-acal-spin .8s linear infinite;
}

@keyframes gafreak-acal-spin{
  to{transform:rotate(360deg)}
}

.gafreak-acal-card{
  display:grid;
  grid-template-columns:minmax(220px,34%) minmax(0,1fr);
  gap:26px;
  align-items:start;
}

.gafreak-acal-media{
  min-width:0;
}

.gafreak-acal-image{
  display:block;
  width:100%;
  height:auto;
  border-radius:12px;
}

.gafreak-acal-image-empty{
  aspect-ratio:63/88;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
  background:#1a2028;
  color:#8f9aa8;
}

.gafreak-acal-info{
  min-width:0;
}

.gafreak-acal-title{
  margin:0 48px 9px 0;
  padding:9px 12px 10px;
  border:1px solid rgba(91,181,255,.30);
  border-radius:10px;
  background:linear-gradient(135deg,#173c5d,#0e2943);
  color:#f3f9ff;
  font-size:clamp(18px,2.4vw,25px);
  line-height:1.25;
  letter-spacing:.01em;
  text-shadow:0 1px 1px rgba(0,0,0,.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    0 3px 12px rgba(0,0,0,.12);
}

.gafreak-acal-meta{
  margin-top:12px;
  margin-bottom:0;
  padding:9px 11px;
  border:1px solid rgba(85,164,232,.22);
  border-radius:9px;
  background:linear-gradient(135deg,#102c48,#0d2238);
  color:#dbeeff;
  font-size:12.5px;
  line-height:1.55;
}

.gafreak-acal-text{
  margin-top:14px;
  padding:14px 16px 15px;
  border:1px solid rgba(80,164,235,.24);
  border-radius:11px;
  background:linear-gradient(135deg,#102b48,#0b2036);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
}

.gafreak-acal-text.is-japanese{
  padding:12px 14px 13px;
  background:linear-gradient(135deg,#123553,#0d2842);
  border-color:rgba(91,181,255,.28);
}

.gafreak-acal-text.is-english{
  background:linear-gradient(135deg,#102942,#0b1f34);
}

.gafreak-acal-text h4{
  margin:0 0 9px;
  color:#eaf6ff;
  font-size:14px;
  letter-spacing:.02em;
}

.gafreak-acal-effect{
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  line-height:1.78;
  color:#f1f7fc;
  text-shadow:0 1px 1px rgba(0,0,0,.22);
}

.gafreak-acal-text.is-japanese .gafreak-acal-effect{
  font-size:14px;
  line-height:1.68;
}

.gafreak-acal-text.is-english .gafreak-acal-effect{
  color:#c1c9d3;
  font-size:13px;
}

.gafreak-acal-flip-note{
  margin-top:14px;
  color:#b9c4d0;
  font-size:13px;
}

.gafreak-acal-actions{
  display:flex;
  justify-content:flex-end;
  margin-top:24px;
}

.gafreak-acal-details{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:9px 16px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:10px;
  color:#fff!important;
  text-decoration:none!important;
  background:rgba(255,255,255,.07);
}

.gafreak-acal-details:hover{
  background:rgba(255,255,255,.12);
}

@media (max-width:680px){
  .gafreak-acal-modal{
    align-items:flex-end;
    padding:0;
  }

  .gafreak-acal-panel{
    width:100%;
    max-height:92svh;
    border-radius:18px 18px 0 0;
  }

  .gafreak-acal-body{
    padding:18px 18px 28px;
  }

  .gafreak-acal-card{
    grid-template-columns:1fr;
    gap:18px;
  }

  .gafreak-acal-media{
    width:min(250px,72vw);
    margin:0 auto;
  }

  .gafreak-acal-title{
    font-size:19px;
  }

  .gafreak-acal-actions{
    justify-content:stretch;
  }

  .gafreak-acal-details{
    width:100%;
  }
}


.gafreak-card-editor-image-link{
  cursor:pointer;
}

.gafreak-card-editor-image-link img{
  cursor:pointer;
}


.gafreak-acal-debug{
  width:100%;
  padding:14px;
  border:1px solid rgba(255,190,80,.35);
  border-radius:10px;
  background:#161b22;
  color:#eef3f8;
  text-align:left;
}

.gafreak-acal-debug strong{
  display:block;
  margin-bottom:9px;
  color:#ffd890;
}

.gafreak-acal-debug pre{
  max-height:260px;
  overflow:auto;
  margin:0;
  padding:10px;
  border-radius:7px;
  background:#0b0f14;
  color:#d8e6f2;
  font-size:11px;
  line-height:1.55;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

.gafreak-acal-debug-copy{
  width:100%;
  min-height:40px;
  margin-top:10px;
  border:1px solid rgba(255,255,255,.16);
  border-radius:8px;
  background:#24384a;
  color:#fff;
  cursor:pointer;
}


/* v1.5.0 Keyword links / popup text links */
.gafreak-article-keyword-link{
  color:inherit;
  text-decoration-style:dotted!important;
  text-decoration-thickness:1px!important;
  text-underline-offset:.16em!important;
}

.gafreak-acal-inline-keyword-link,
.gafreak-acal-inline-card-link{
  display:inline;
  padding:0;
  border:0;
  background:transparent;
  font:inherit;
  line-height:inherit;
  cursor:pointer;
  text-decoration:underline;
  text-decoration-thickness:1px;
  text-underline-offset:3px;
}

.gafreak-acal-inline-keyword-link{
  color:#f7d77a!important;
  text-decoration-style:dotted;
}

.gafreak-acal-inline-card-link{
  color:#8ed5ff!important;
  text-decoration-style:solid;
}

.gafreak-acal-card-back[hidden]{
  display:none!important;
}

.gafreak-acal-card-back{
  position:sticky;
  top:10px;
  float:left;
  z-index:4;
  min-height:42px;
  margin:10px 0 -52px 10px;
  padding:0 13px;
  border:1px solid rgba(77,157,221,.9);
  border-radius:999px;
  background:#17314a;
  color:#b9e6ff;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 4px 18px rgba(0,0,0,.35);
}

.gafreak-acal-keyword-modal[hidden]{
  display:none!important;
}

.gafreak-acal-keyword-modal{
  position:fixed;
  inset:0;
  z-index:2147483200;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
}

.gafreak-acal-keyword-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.72);
  backdrop-filter:blur(3px);
}

.gafreak-acal-keyword-panel{
  position:relative;
  z-index:1;
  width:min(600px,94vw);
  max-height:82vh;
  overflow:auto;
  padding:22px;
  border:1px solid #426b8b;
  border-radius:16px;
  background:#111c26;
  color:#f4f7fa;
  box-shadow:0 18px 60px rgba(0,0,0,.55);
}

.gafreak-acal-keyword-close{
  position:absolute;
  top:10px;
  right:10px;
  width:42px;
  height:42px;
  border-radius:50%;
  border:1px solid #496075;
  background:#18232e;
  color:#fff;
  font-size:26px;
  line-height:38px;
  cursor:pointer;
}

.gafreak-acal-keyword-kicker{
  margin:0 48px 7px 0;
  color:#67cfff;
  font-size:11px;
  font-weight:900;
  letter-spacing:.05em;
}

.gafreak-acal-keyword-title{
  display:block;
  margin:0 48px 14px 0;
  padding:10px 13px;
  border:1px solid #4d9ddd;
  border-radius:10px;
  background:linear-gradient(135deg,#173c5d,#1e4f79);
  color:#f5fbff;
  font-size:22px;
  font-weight:900;
  line-height:1.3;
  text-shadow:0 1px 1px rgba(0,0,0,.28);
}

.gafreak-acal-keyword-description{
  white-space:pre-wrap;
  line-height:1.8;
  color:#eef4f8;
  font-size:14px;
}

.gafreak-acal-keyword-source{
  display:inline-flex;
  margin-top:18px;
  padding:9px 12px;
  border:1px solid #4d9ddd;
  border-radius:9px;
  background:#17314a;
  color:#a9ddff!important;
  text-decoration:none!important;
  font-weight:800;
}

@media (max-width:680px){
  .gafreak-acal-keyword-modal{
    align-items:flex-end;
    padding:12px;
  }

  .gafreak-acal-keyword-panel{
    width:100%;
    max-height:78vh;
    border-radius:16px 16px 10px 10px;
    padding:20px 18px;
  }

  .gafreak-acal-card-back{
    position:sticky;
    top:10px;
  }
}


/* v1.5.5: feedback when a popup-local short card reference points to the
   card already being displayed. */
@keyframes gafreak-acal-reference-target{
  0%,100%{box-shadow:none}
  35%{box-shadow:0 0 0 3px rgba(99,184,255,.42),0 0 20px rgba(99,184,255,.22)}
}
