﻿html {
    height: 100%;
}

body {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    color: var(--text-main);
    background-color: #0f172a;
    touch-action: none;
    overscroll-behavior-y: none;
}

#desktop {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    height: calc(100vh - 48px); /* 繧ｿ繧ｹ繧ｯ繝舌・縺ｮ鬮倥＆繧貞ｼ輔￥ */
}

:root {
    --win-bg: rgba(35, 35, 35, 0.85);
    --win-border: rgba(255, 255, 255, 0.15);
    --win-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --taskbar-bg: rgba(30, 30, 30, 0.9);
    --taskbar-hover: rgba(255, 255, 255, 0.1);
    --accent: #4cc2ff;
    --accent-hover: #0088d6;
    --text-main: #f0f0f0;
    --text-desktop: #ffffff;
    --font-family: 'Segoe UI', 'Meiryo', 'Noto Sans JP', sans-serif;
}

* {
    box-sizing: border-box;
    font-family: var(--font-family);
    user-select: none;
}

body {
    margin: 0;
    padding: 0;
    color: var(--text-main);
    background-color: #0f172a;
    background-image:
        radial-gradient(circle at 80% 0%, #1e3a8a 0%, transparent 40%),
        radial-gradient(circle at 20% 100%, #312e81 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, #0ea5e9 0%, transparent 60%);
    touch-action: none;
    overscroll-behavior-y: none;
}

.company-name {
    position: absolute;
    top: -10px;
    right: -80px;
    pointer-events: none;
    z-index: 50;
    display: flex;
    align-items: center;
    height: 150px;
}

.company-name::before {
    content: "";
    position: absolute;
    top: 40%;
    left: 60%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 150%;
    z-index: -1;
}

.company-name img {
    height: 100%;
    display: block;
    pointer-events: auto;
    cursor: pointer;
}

.desktop-calendar {
    position: absolute;
    bottom: 10px;
    right: 30px;
    color: var(--text-desktop);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 50;
    width: 220px;
}

.cal-header {
    text-align: right;
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: bold;
    letter-spacing: 1px;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
    font-size: 13px;
}

.cal-cell {
    width: 26px;
    height: 26px;
    line-height: 26px;
    margin: 0 auto;
}

.cal-day-name {
    font-size: 11px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
}

.cal-today {
    background-color: var(--accent);
    border-radius: 50%;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.icon {
    position: absolute;
    width: 86px;
    text-align: center;
    cursor: pointer;
    color: var(--text-desktop);
    font-size: 12px;
    padding: 8px 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    z-index: 50;
}

.icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.icon.selected {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.icon-img {
    font-size: 36px;
    margin-bottom: 4px;
    text-shadow: none;
    pointer-events: none;
    display: block;
}

.taskbar {
    height: 48px;
    background-color: var(--taskbar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    z-index: 9000;
    flex-shrink: 0;
}

.tb-icon {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
    font-size: 20px;
}

.tb-icon:hover {
    background-color: var(--taskbar-hover);
}

.start-btn {
    color: #0078d4;
    font-size: 22px;
}

.start-btn.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.taskbar-clock {
    position: absolute;
    right: 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    font-size: 12px;
    line-height: 1.3;
    color: #ffffff;
    cursor: default;
}

.taskbar-clock .date {
    font-size: 10px;
}

.start-menu {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    max-width: calc(100vw - 20px);
    background-color: var(--win-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--win-border);
    border-radius: 12px;
    box-shadow: var(--win-shadow);
    display: none;
    flex-direction: column;
    padding: 20px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.start-menu.show {
    display: flex;
    opacity: 1;
}

.start-menu h3 {
    margin: 0 0 15px 0;
    font-size: 14px;
    padding-left: 10px;
}

.start-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.start-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: 0.2s;
}

.start-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.start-item .icon-img {
    font-size: 24px;
    margin-bottom: 5px;
}

.context-menu {
    position: fixed;
    background-color: var(--win-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--win-border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    padding: 5px 0;
    z-index: 20000;
    min-width: 180px;
}

.context-menu-item {
    padding: 8px 15px;
    font-size: 12px;
    color: var(--text-main);
    cursor: pointer;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.context-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.context-menu-item.has-submenu .submenu {
    position: absolute;
    left: 100%;      /* JSで上書きされる */
    top: -6px;       /* JSで上書きされる */
    display: none;
    background-color: var(--win-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--win-border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    padding: 5px 0;
    min-width: 150px;
    z-index: 20001;
}

/* PCホバーで表示 */
@media (hover: hover) and (pointer: fine) {
    .context-menu-item.has-submenu:hover > .submenu {
        display: flex;
        flex-direction: column;
    }
}

/* スマホ：タップでJSが付与するクラスで表示 */
.context-menu-item.has-submenu.submenu-open > .submenu {
    display: flex;
    flex-direction: column;
}

/* サブメニューを左側に出すとき */
.context-menu.submenu-left .context-menu-item.has-submenu .submenu {
    left: auto;
    right: 100%;
}

.window {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 450px;
    max-width: calc(100vw - 20px);
    background-color: var(--win-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--win-border);
    border-radius: 8px;
    display: none;
    max-height: calc(100vh - 60px);
    flex-direction: column;
    box-shadow: var(--win-shadow);
    overflow: hidden;
}

.title-bar {
    height: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 15px;
    font-size: 12px;
    color: var(--text-main);
    cursor: default;
}

.title-bar-controls {
    display: flex;
    height: 100%;
}

.control-btn {
    width: 46px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

.control-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.close-btn:hover {
    background-color: #e81123;
    color: white;
}

.window-content {
    padding: 20px;
    background-color: rgba(45, 45, 45, 0.6);
    flex: 1;
    user-select: text;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
}

h2 {
    margin-top: 0;
    font-size: 20px;
    font-weight: normal;
    margin-bottom: 15px;
}

p,
li {
    font-size: 13px;
    line-height: 1.6;
    color: #cccccc;
}

ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

li {
    margin-bottom: 5px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    font-size: 12px;
    margin-bottom: 5px;
    color: #bbbbbb;
}

input,
textarea,
select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.2);
    font-family: var(--font-family);
    font-size: 13px;
    color: #ffffff;
    outline: none;
    transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    background-color: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 3px rgba(76, 194, 255, 0.25);
}

button.submit-btn {
    background-color: var(--accent);
    color: #000;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    padding: 8px 20px;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
}

button.submit-btn:hover {
    background-color: var(--accent-hover);
    color: #ffffff;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.photo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.photo-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    pointer-events: none;
}

.photo-item:hover .photo-thumb {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.photo-title {
    margin-top: 5px;
    font-size: 11px;
    color: #aaaaaa;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

#win-photo-viewer {
    width: auto;
    height: auto;
}

#win-photo-viewer .window-content {
    padding: 0;
    background-color: #000;
    display: block;
    overflow: hidden;
    width: 100%;
    height: calc(100% - 32px);
    max-height: none;
}

#win-photo-viewer img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.prev-btn, .next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    z-index: 10;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    outline: none; /* ブラウザ標準のフォーカスアウトラインを無効化 */
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.prev-btn:hover, .next-btn:hover {
    background-color: rgba(255, 153, 0, 0.8);
}

.prev-btn:active, .next-btn:active {
    background-color: rgba(255, 153, 0, 1);
}

/* 常に表示されるカスタムフォーカススタイル */
.prev-btn:focus, .next-btn:focus {
    box-shadow: 0 0 0 3px rgba(76, 194, 255, 0.6);
}


::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 0;
}

.radio-label input[type="radio"] {
    width: auto;
    margin: 0 6px 0 0;
    cursor: pointer;
}

#contact-confirm p.confirm-value {
    font-size: 14px;
    background: #333333;
    padding: 10px;
    border-radius: 4px;
    min-height: 1.5em;
    white-space: pre-wrap;
    word-break: break-all;
    cursor: pointer;
    color: #e0e0e0;
}

/* 讌ｭ蜍吝・螳ｹ・・ervices・臥畑縺ｮ繧ｹ繧ｿ繧､繝ｫ */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.service-card {
    position: relative;
    background: rgba(18, 22, 32, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    isolation: isolate;
}

/* 繧ｰ繝ｩ繝・・繧ｷ繝ｧ繝ｳ豬√ｌ繧九い繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ逕ｨ縺ｮ逍台ｼｼ隕∫ｴ */
.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: linear-gradient(
        125deg,
        rgba(76, 194, 255, 0.07) 0%,
        rgba(130, 80, 255, 0.10) 25%,
        rgba(0, 200, 160, 0.07) 50%,
        rgba(76, 194, 255, 0.04) 75%,
        rgba(130, 80, 255, 0.10) 100%
    );
    background-size: 300% 300%;
    animation: card-gradient-flow 6s ease infinite;
    z-index: 0;
    pointer-events: none;
}

/* 繧ｫ繝ｼ繝臥分蜿ｷ縺斐→縺ｫ繧｢繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ縺ｮ菴咲嶌繧偵★繧峨☆ */
.service-card:nth-child(1)::before { animation-delay: 0s; }
.service-card:nth-child(2)::before { animation-delay: -1.5s; }
.service-card:nth-child(3)::before { animation-delay: -3s; }
.service-card:nth-child(4)::before { animation-delay: -4.5s; }
.service-card:nth-child(5)::before { animation-delay: -2s; }
.service-card:nth-child(6)::before { animation-delay: -0.8s; }
.service-card:nth-child(7)::before { animation-delay: -3.5s; }

@keyframes card-gradient-flow {
    0%   { background-position: 0% 0%; }
    50%  { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

/* 蜈峨・襍ｰ繧九す繝｣繧､繝ｳ蜉ｹ譫・*/
.service-card::after {
    content: '';
    position: absolute;
    top: -60%;
    left: -80%;
    width: 60%;
    height: 200%;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.04) 50%,
        rgba(255, 255, 255, 0.07) 55%,
        rgba(255, 255, 255, 0.04) 60%,
        transparent 70%
    );
    transform: skewX(-15deg);
    animation: card-shine 5s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

.service-card:nth-child(1)::after { animation-delay: 0s; }
.service-card:nth-child(2)::after { animation-delay: -1.2s; }
.service-card:nth-child(3)::after { animation-delay: -2.4s; }
.service-card:nth-child(4)::after { animation-delay: -3.6s; }
.service-card:nth-child(5)::after { animation-delay: -1.8s; }
.service-card:nth-child(6)::after { animation-delay: -0.6s; }
.service-card:nth-child(7)::after { animation-delay: -3s; }

@keyframes card-shine {
    0%, 40%  { left: -80%; opacity: 0; }
    42%      { opacity: 1; }
    60%      { left: 110%; opacity: 1; }
    62%, 100% { left: 110%; opacity: 0; }
}

/* 繝懊・繝繝ｼ縺ｮ逋ｺ蜈峨い繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ */
@keyframes card-border-glow {
    0%, 100% { border-color: rgba(76, 194, 255, 0.12); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
    50%      { border-color: rgba(130, 80, 255, 0.28); box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 12px rgba(130,80,255,0.10); }
}

.service-card {
    animation: card-border-glow 6s ease-in-out infinite;
}

.service-card:nth-child(1) { animation-delay: 0s; }
.service-card:nth-child(2) { animation-delay: -1.5s; }
.service-card:nth-child(3) { animation-delay: -3s; }
.service-card:nth-child(4) { animation-delay: -4.5s; }
.service-card:nth-child(5) { animation-delay: -2s; }
.service-card:nth-child(6) { animation-delay: -0.8s; }
.service-card:nth-child(7) { animation-delay: -3.5s; }

.service-card:hover {
    transform: translateY(-5px);
    background: rgba(25, 30, 45, 0.92);
    border-color: rgba(76, 194, 255, 0.5) !important;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45), 0 0 20px rgba(76, 194, 255, 0.15) !important;
    animation: none;
}

/* 繧ｫ繝ｼ繝牙・縺ｮ繧ｳ繝ｳ繝・Φ繝・・ z-index 縺ｧ逍台ｼｼ隕∫ｴ繧医ｊ蜑埼擇縺ｫ */
.service-content {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.service-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.service-icon {
    font-size: 28px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(76, 194, 255, 0.2) 0%, rgba(76, 194, 255, 0.05) 100%);
    border: 1px solid rgba(76, 194, 255, 0.2);
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.1);
}

.service-header-title {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-content h3 {
    margin: 0;
    font-size: 18px;
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

.service-tag {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.service-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-features li {
    position: relative;
    padding-left: 24px;
    font-size: 13px;
    color: #cccccc;
    margin-bottom: 0;
    line-height: 1.5;
}

.service-features li::before {
    content: "✔ ";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent);
    font-size: 12px;
    font-weight: bold;
}

.service-content .comment {
    font-size: 12px;
    color: #e2e8f0;
    background: rgba(76, 194, 255, 0.1);
    padding: 12px 16px;
    border-radius: 8px;
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid rgba(76, 194, 255, 0.15);
}

/* 螳溽ｸｾ・・esults・臥畑縺ｮ繧ｹ繧ｿ繧､繝ｫ */
.result-list-item {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    text-decoration: none;
    color: inherit;
}

.result-list-item:hover {
    transform: translateY(-5px);
    border-color: rgba(76, 194, 255, 0.5);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4), 0 0 15px rgba(76, 194, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.result-list-item-img {
    width: 160px;
    height: 100px;
    object-fit: cover;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: #ffffff;
}

.result-list-item-content {
    padding: 15px 20px;
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-list-item-text h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #ffffff;
}

.result-list-item-text p {
    margin: 0;
    font-size: 12px;
    color: #aaaaaa;
}

.result-list-item-icon {
    font-size: 20px;
    color: #aaaaaa;
    margin-left: 15px;
    transition: color 0.3s;
}

.result-list-item:hover .result-list-item-icon {
    color: #4cc2ff;
}

.other-results-structured {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-category {
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.result-category:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.result-category h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--accent);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-category ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

.result-category li {
    margin-bottom: 0;
    padding-left: 18px;
    position: relative;
    color: #cccccc;
    line-height: 1.5;
}

.result-category li::before {
    content: '✔ ';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent);
    font-weight: bold;
    transition: transform 0.2s ease;
}

.result-category li:hover::before {
    transform: translateX(3px);
}

/* =============================================
   Kuni Game Styles - Completely Rewritten
   ============================================= */
#win-kuni {
    width: 580px !important;
    max-width: calc(100vw - 20px) !important;
}

@keyframes window-shake {
    10%,
    90% {
        transform: translate(-2px, 0);
    }
    20%,
    80% {
        transform: translate(4px, 0);
    }
    30%,
    50%,
    70% {
        transform: translate(-6px, 0);
    }
    40%,
    60% {
        transform: translate(6px, 0);
    }
}

.window.shaking {
    animation: window-shake 1.4s cubic-bezier(.36, .07, .19, .97) both;
}

#kuni-map {
    background-color: #1a3318;
    background-image:
        radial-gradient(ellipse at 20% 30%, rgba(40, 90, 30, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(20, 60, 20, 0.5) 0%, transparent 50%),
        linear-gradient(160deg, #1a3318 0%, #0a1708 100%);
    border: 3px solid #48782a;
    border-radius: 6px;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9), 0 0 0 1px #000, 0 4px 20px rgba(0, 0, 0, 0.8);
    margin: 4px;
    overflow: hidden;
    position: relative;
}

#kuni-map::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0px, transparent 1px, transparent 40px),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0px, transparent 1px, transparent 40px);
    pointer-events: none;
    z-index: 0;
}

.kuni-cell {
    position: absolute;
    width: 60px;
    height: 68px;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.15s ease;
    font-weight: bold;
    color: white;
    font-family: 'Courier New', Courier, monospace;
    background: none;
    border: none;
    padding-bottom: 2px;
    z-index: 2;
}

.kuni-cell .castle-icon {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 38px;
    line-height: 1;
    pointer-events: none;
    transition: filter 0.3s ease, transform 0.15s ease;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.95));
}

.kuni-cell.neutral .fort-pole { fill: #bbbbbb; }
.kuni-cell.neutral .fort-flag-1 { fill: #ddcc44; }
.kuni-cell.neutral .fort-flag-2 { fill: #aa9922; }
.kuni-cell.neutral .fort-wall { fill: #888880; }
.kuni-cell.neutral .fort-wall-light { fill: #999990; }
.kuni-cell.neutral .fort-shadow { fill: #555550; }
.kuni-cell.neutral .fort-window { fill: #222222; }
.kuni-cell.neutral .fort-gate { fill: #222222; }
.kuni-cell.neutral .fort-base { fill: #777770; }
.kuni-cell.neutral .fort-base-dark { fill: #555550; }

.kuni-cell.player .fort-pole { fill: #aaddff; }
.kuni-cell.player .fort-flag-1 { fill: #2255dd; }
.kuni-cell.player .fort-flag-2 { fill: #1144bb; }
.kuni-cell.player .fort-wall { fill: #3377ee; }
.kuni-cell.player .fort-wall-light { fill: #4488ff; }
.kuni-cell.player .fort-shadow { fill: #1144aa; }
.kuni-cell.player .fort-window { fill: #aaddff; }
.kuni-cell.player .fort-gate { fill: #112244; }
.kuni-cell.player .fort-base { fill: #336699; }
.kuni-cell.player .fort-base-dark { fill: #224477; }

.kuni-cell.enemy .fort-pole { fill: #ffaaaa; }
.kuni-cell.enemy .fort-flag-1 { fill: #cc1111; }
.kuni-cell.enemy .fort-flag-2 { fill: #991111; }
.kuni-cell.enemy .fort-wall { fill: #cc2222; }
.kuni-cell.enemy .fort-wall-light { fill: #dd3333; }
.kuni-cell.enemy .fort-shadow { fill: #881111; }
.kuni-cell.enemy .fort-window { fill: #ff8844; }
.kuni-cell.enemy .fort-gate { fill: #220000; }
.kuni-cell.enemy .fort-base { fill: #aa2222; }
.kuni-cell.enemy .fort-base-dark { fill: #771111; }

.kuni-cell.dragon .fort-pole { fill: #ffaaaa; }
.kuni-cell.dragon .fort-flag-1 { fill: #cc1111; }
.kuni-cell.dragon .fort-flag-2 { fill: #991111; }
.kuni-cell.dragon .fort-wall { fill: #cc2222; }
.kuni-cell.dragon .fort-wall-light { fill: #dd3333; }
.kuni-cell.dragon .fort-shadow { fill: #881111; }
.kuni-cell.dragon .fort-window { fill: #ff8844; }
.kuni-cell.dragon .fort-gate { fill: #220000; }
.kuni-cell.dragon .fort-base { fill: #aa2222; }
.kuni-cell.dragon .fort-base-dark { fill: #771111; }

.kuni-cell.e2 .fort-pole { fill: #ff9999; }
.kuni-cell.e2 .fort-flag-1 { fill: #cc0000; }
.kuni-cell.e2 .fort-flag-2 { fill: #880000; }
.kuni-cell.e2 .fort-wall { fill: #660000; }
.kuni-cell.e2 .fort-wall-light { fill: #770000; }
.kuni-cell.e2 .fort-shadow { fill: #330000; }
.kuni-cell.e2 .fort-window { fill: #ff2200; }
.kuni-cell.e2 .fort-gate { fill: #110000; }
.kuni-cell.e2 .fort-base { fill: #550000; }
.kuni-cell.e2 .fort-base-dark { fill: #330000; }

.kuni-cell .aura {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    filter: blur(14px);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: -1;
}

.kuni-cell .power {
    font-size: 18px;
    font-weight: 900;
    z-index: 2;
    text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 0 2px 0 #000, 0 -2px 0 #000, 2px 0 0 #000, -2px 0 0 #000;
    pointer-events: none;
    line-height: 1;
}

.kuni-cell .growth {
    font-size: 11px;
    z-index: 2;
    opacity: 0.85;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
    pointer-events: none;
    line-height: 1;
    margin-top: 1px;
}

.kuni-cell.player {
    cursor: grab;
}

.kuni-cell.player:active {
    cursor: grabbing;
}

.kuni-cell.player .castle-icon {
    filter: hue-rotate(190deg) saturate(220%) brightness(1.2);
}

.kuni-cell.player .aura {
    background: rgba(59, 130, 246, 0.75);
    opacity: 0;
}

.kuni-cell.player .power {
    color: #93c5fd;
}

.kuni-cell.player .growth {
    color: #60a5fa;
}

.kuni-cell.player.selected .castle-icon {
    font-size: 44px;
    filter: drop-shadow(0 0 18px rgba(255, 220, 60, 1)) drop-shadow(0 0 6px rgba(255, 255, 255, 1)) hue-rotate(190deg) saturate(300%) brightness(1.5);
}

.kuni-cell.player.selected .aura {
    background: rgba(250, 204, 21, 0.9);
    animation: none;
}

.kuni-cell.player.selected .power {
    color: #fde68a;
}

.kuni-cell.enemy .castle-icon {
    filter: hue-rotate(330deg) saturate(180%) brightness(1.05);
}

.kuni-cell.enemy .aura {
    background: rgba(220, 38, 38, 0.7);
    opacity: 0;
}

.kuni-cell.enemy .power {
    color: #fca5a5;
}

.kuni-cell.enemy .growth {
    color: #f87171;
}

.kuni-cell.neutral .castle-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8)) grayscale(0.4) brightness(0.75);
}

.kuni-cell.neutral .aura {
    background: rgba(160, 130, 80, 0.4);
    opacity: 0;
}

.kuni-cell.neutral .power {
    color: #d4b896;
}

.kuni-cell.e2 .castle-icon {
    filter: none;
}

.kuni-cell.e2 .power {
    color: #ff4444;
}

.kuni-cell.e2 .growth {
    color: #ff6666;
}

.kuni-cell.neutral .growth {
    color: #a89070;
}

@keyframes kuni-pulse {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translateX(-50%) scale(1.3);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.7;
    }
}

@keyframes kuni-attack-flash {
    0% {
        filter: brightness(3) saturate(0);
    }
    100% {
        filter: brightness(1) saturate(1);
    }
}

.kuni-cell.attacking {
    animation: kuni-attack-flash 0.3s ease-out;
}

@keyframes kuni-captured {
    0% {
        transform: translate(-50%, -50%) scale(1.4);
    }
    60% {
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

.kuni-cell.captured {
    animation: kuni-captured 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

.kuni-cell.legendary {
    width: 76px;
    height: 84px;
    z-index: 4;
}

.kuni-cell.legendary .castle-icon {
    display: none;
}

.kuni-cell.legendary .legend-wrap {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    transform-origin: center bottom;
}

.kuni-cell.legendary .logo-img {
    width: 72px;
    height: auto;
    display: block;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.9));
}

.kuni-cell.legendary .castle-svg {
    width: 62px;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 8px rgba(200, 0, 0, 0.9)) drop-shadow(0 0 3px rgba(255, 50, 0, 0.7));
    animation: boss-castle-pulse 2s ease-in-out infinite;
}

@keyframes boss-castle-pulse {
    0% {
        filter: drop-shadow(0 0 8px rgba(200, 0, 0, 0.9)) drop-shadow(0 0 3px rgba(255, 50, 0, 0.7));
    }
    50% {
        filter: drop-shadow(0 0 18px rgba(255, 0, 0, 1)) drop-shadow(0 0 7px rgba(255, 80, 0, 0.9)) drop-shadow(0 0 2px rgba(255, 200, 0, 0.5));
    }
    100% {
        filter: drop-shadow(0 0 8px rgba(200, 0, 0, 0.9)) drop-shadow(0 0 3px rgba(255, 50, 0, 0.7));
    }
}

@keyframes boss-entrance {
    0% {
        transform: translate(-50%, -50%) scale(4.0);
        opacity: 0;
        filter: brightness(3) drop-shadow(0 0 30px #ff0000);
    }
    15% {
        transform: translate(-50%, -50%) scale(3.5);
        opacity: 1;
        filter: brightness(2) drop-shadow(0 0 20px #ff0000);
    }
    70% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
        filter: brightness(1.3) drop-shadow(0 0 10px #ff0000);
    }
    85% {
        transform: translate(-50%, -50%) scale(0.88);
        opacity: 1;
        filter: brightness(1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        filter: brightness(1);
    }
}

.kuni-cell.legendary.boss-entering {
    animation: boss-entrance 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both !important;
}

.kuni-cell.legendary.selected .logo-img {
    filter: drop-shadow(0 0 10px #ff4400) drop-shadow(0 0 4px #fff);
}

.kuni-cell.legendary.selected .castle-svg {
    filter: drop-shadow(0 0 24px rgba(255, 0, 0, 1)) drop-shadow(0 0 10px rgba(255, 100, 0, 1)) drop-shadow(0 0 4px rgba(255, 220, 0, 0.8));
    animation: none;
}

.kuni-cell.legendary.selected .aura {
    background: radial-gradient(circle, rgba(255, 0, 0, 0.7) 0%, rgba(180, 0, 0, 0.4) 60%, transparent 100%);
    opacity: 1;
    animation: boss-aura-pulse 1.2s ease-in-out infinite;
    width: 60px;
    height: 60px;
}

@keyframes boss-aura-pulse {
    0% {
        opacity: 0.7;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.15);
    }
    100% {
        opacity: 0.7;
        transform: translateX(-50%) scale(1);
    }
}

.kuni-cell.legendary .aura {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(200, 0, 0, 0.5) 0%, rgba(100, 0, 0, 0.2) 70%, transparent 100%);
    opacity: 0.5;
    animation: boss-aura-idle 3s ease-in-out infinite;
}

@keyframes boss-aura-idle {
    0% {
        opacity: 0.3;
        transform: translateX(-50%) scale(0.95);
    }
    50% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1.05);
    }
    100% {
        opacity: 0.3;
        transform: translateX(-50%) scale(0.95);
    }
}

.kuni-cell.legendary .power {
    color: #ff4444;
    font-size: 17px;
    text-shadow: 0 0 8px #ff0000, 2px 2px 0 #000, -2px -2px 0 #000;
}

.kuni-cell.legendary .growth {
    color: #ff8800;
    font-size: 11px;
    text-shadow: 0 0 4px #ff4400, 1px 1px 0 #000;
}

.kuni-edge-legendary {
    stroke: rgba(255, 190, 0, 0.65);
}

#kuni-status {
    font-family: 'Courier New', Courier, monospace;
}

#kuni-stats-bar {
    display: flex;
    gap: 16px;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    color: #aaa;
    margin-top: 6px;
}

#kuni-stats-bar span {
    color: #fff;
    font-weight: bold;
}

.kuni-stat-player { color: #60a5fa !important; }
.kuni-stat-enemy { color: #f87171 !important; }
.kuni-stat-e2 { color: #ffd700 !important; }
.kuni-stat-turn { color: #facc15 !important; }

@keyframes video-spin {
    to { transform: rotate(360deg); }
}

.copyright {
    position: absolute;
    bottom: 10px;
    left: 10px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
    z-index: 50;
    letter-spacing: 1px;
}

/* =============================================
   BLASTER Game Styles
   ============================================= */
#win-shoot {
    width: 520px;
    max-width: calc(100vw - 20px);
    user-select: none;
}

#shoot-canvas-wrap {
    position: relative;
    background: #000;
    line-height: 0;
}

#shoot-canvas {
    display: block;
    width: 500px;
    max-width: 100%;
    height: auto;
    height: 460px;
    cursor: none;
}

#shoot-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    color: #fff;
    font-family: 'Courier New', monospace;
    text-align: center;
    pointer-events: none;
}

#shoot-overlay h1 {
    font-size: 42px;
    letter-spacing: 8px;
    margin: 0 0 6px;
    color: #00ffcc;
    text-shadow: 0 0 20px #00ffcc, 0 0 40px #00ffcc;
    animation: stpulse 1.6s ease-in-out infinite;
}

#shoot-overlay .sub {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 22px;
    letter-spacing: 2px;
}

#shoot-overlay .prompt {
    font-size: 16px;
    color: #fff;
    letter-spacing: 3px;
    animation: stblink 1s step-end infinite;
}

#shoot-overlay .gameover-title {
    font-size: 36px;
    letter-spacing: 6px;
    color: #ff4455;
    text-shadow: none;
    margin: 0 0 24px;
}

#shoot-overlay .score-final {
    font-size: 20px;
    color: #ffdd44;
    margin-bottom: 28px;
    line-height: 1.8;
}

@keyframes stpulse {
    0%,
    100% {
        text-shadow: 0 0 16px #00ffcc, 0 0 32px #00ffcc;
    }
    50% {
        text-shadow: 0 0 32px #00ffcc, 0 0 64px #00ffcc, 0 0 80px #0af;
    }
}

@keyframes stblink {
    50% {
        opacity: 0;
    }
}

/* =============================================
   Command List Styles (萓ｿ蛻ｩ繧ｳ繝槭Φ繝蛾寔)
   ============================================= */
.cmd-tips {
    background: rgba(0, 0, 0, 0.4);
    border-left: 4px solid var(--accent);
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.cmd-tips-title {
    margin: 0 0 6px 0;
    font-size: 13px;
    color: var(--accent);
    font-weight: bold;
}

.cmd-tips-text {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #e2e8f0;
    line-height: 1.6;
}

.cmd-tips-note {
    margin: 0;
    font-size: 11px;
    color: #94a3b8;
}

.command-category {
    margin-bottom: 20px;
}

.command-category h3 {
    margin: 0 0 8px 0;
    font-size: 15px;
    color: #4ade80;
    font-family: 'Courier New', monospace;
    border-bottom: 1px dashed rgba(74, 222, 128, 0.3);
    padding-bottom: 6px;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(74, 222, 128, 0.2);
}

.command-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.command-item {
    display: flex;
    align-items: flex-start;
    padding: 6px 4px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
}

.command-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.command-item:last-child {
    border-bottom: none;
}

.cmd-name {
    font-family: 'Courier New', monospace;
    color: #4cc2ff;
    font-weight: bold;
    background: rgba(76, 194, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin-right: 12px;
    cursor: pointer;
    min-width: 130px;
    display: inline-block;
    transition: background 0.2s, color 0.2s;
    position: relative;
}

.cmd-name:hover {
    background: rgba(76, 194, 255, 0.3);
    color: #ffffff;
}

.cmd-name:active {
    background: rgba(76, 194, 255, 0.5);
}

.cmd-name.copied::after {
    content: "Copied!";
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: #4ade80;
    color: #000;
    font-size: 10px;
    font-family: var(--font-family);
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    animation: fadeOutUp 1s forwards;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.cmd-desc {
    color: #cccccc;
    font-size: 12px;
    line-height: 1.6;
    flex: 1;
    padding-top: 3px;
}

/* =============================================
   Responsive Design (繧ｹ繝槭・繝医ヵ繧ｩ繝ｳ蟇ｾ蠢・
   ============================================= */
@media (max-width: 768px) {
    /* 繧ｦ繧｣繝ｳ繝峨え繧堤判髱｢荳ｭ螟ｮ・亥ｷｦ蜿ｳ蝮・ｭ会ｼ峨↓蝗ｺ螳夐・鄂ｮ */
    .window {
        left: 10px !important;
        width: calc(100vw - 20px) !important;
        margin: 0 !important;
    }

    #win-kuni,
    #win-shoot {
        left: 10px !important;
        width: calc(100vw - 20px) !important;
        margin: 0 !important;
    }

    /* 讌ｭ蜍吝・螳ｹ繧ｫ繝ｼ繝峨・繝ｬ繧ｹ繝昴Φ繧ｷ繝門ｯｾ蠢・*/
    .service-card {
        padding: 16px;
    }

    .service-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 12px;
    }

    .service-icon {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }

    .service-content h3 {
        font-size: 16px;
    }

    .service-features li {
        font-size: 12px;
    }

    /* 螳溽ｸｾ繝ｪ繧ｹ繝医・繝ｬ繧ｹ繝昴Φ繧ｷ繝門ｯｾ蠢・*/
    .result-list-item {
        flex-direction: column;
    }

    .result-list-item-img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .result-list-item-content {
        width: 100%;
    }
    
    /* 繧ｹ繝槭・縺ｧ縺ｯ繧ｫ繝ｬ繝ｳ繝繝ｼ繧貞承荳九↓蟆上＆縺剰｡ｨ遉ｺ */
    .desktop-calendar {
        bottom: 10px; /* 繧ｿ繧ｹ繧ｯ繝舌・縺九ｉ縺ｮ菴咏區繧定ｪｿ謨ｴ */
        right: 5px;
        transform: scale(0.7); /* 70%縺ｫ邵ｮ蟆・*/
        transform-origin: bottom right; /* 蜿ｳ荳九ｒ蝓ｺ轤ｹ縺ｫ邵ｮ蟆・*/
    }

    /* 萓ｿ蛻ｩ繧ｳ繝槭Φ繝蛾寔縺ｮ繝ｬ繧ｹ繝昴Φ繧ｷ繝門ｯｾ蠢・*/
    .command-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 4px;
    }
    .cmd-name {
        margin-right: 0;
        min-width: auto;
    }
    .cmd-desc {
        padding-left: 8px;
        padding-top: 0;
    }

    .taskbar {
        justify-content: flex-start;
        padding-left: 10px;
    }

    #icon-typing-game {
        display: none !important;
    }
}

@keyframes fadeOutUp {
    0% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -10px); }
}

#shoot-canvas,
#kuni-map,
#fire-canvas {
    touch-action: none;
}

/* 轣ｫ豸医＠繧ｲ繝ｼ繝縺ｮ繧ｹ繝槭・逕ｻ髱｢縺ｯ縺ｿ蜃ｺ縺嶺ｿｮ豁｣ */
#win-fire {
    width: 520px;
    max-width: calc(100vw - 20px);
}
#fire-canvas {
    display: block;
    width: 100%;
    height: auto;
}

/* 繧ｹ繝槭・譎ゅ・荳ｭ螟ｮ驟咲ｽｮ縺ｫ轣ｫ豸医＠(win-fire)繧定ｿｽ蜉 */
@media (max-width: 768px) {
    #win-kuni,
    #win-shoot,
    #win-fire {
        left: 10px !important;
        width: calc(100vw - 20px) !important;
        margin: 0 !important;
    }
}

/* 繧ｵ繧､繝医・繝ｪ繧ｷ繝ｼ縺ｮ蠕舌・↓證苓ｻ｢縺吶ｋ繧ｨ繝輔ぉ繧ｯ繝・*/
#policy-crawl-overlay {
    opacity: 0;
    transition: opacity 0.8s ease; /* 0.8遘偵°縺代※證励￥/譏弱ｋ縺上☆繧・*/
}
#policy-crawl-overlay.show {
    opacity: 1;
}

/* =============================================
   Cyberpunk Contact Form Styles
   ============================================= */
.cyberpunk-form-container {
    position: relative;
}

.cyber-header {
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(76, 194, 255, 0.3);
    padding-bottom: 10px;
}

.cyber-header h2 {
    color: #4cc2ff;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    letter-spacing: 2px;
    margin: 0 0 5px 0;
    text-shadow: 0 0 10px rgba(76, 194, 255, 0.5);
}

.cyber-header .cyber-sub {
    color: #4ade80;
    font-size: 11px;
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    letter-spacing: 1px;
    animation: pulse-opacity 2s infinite;
}

@keyframes pulse-opacity {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.cyber-form-group {
    position: relative;
    margin-bottom: 30px;
}

.cyber-form-group input,
.cyber-form-group textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 20px 10px 8px;
    font-family: var(--font-family);
    font-size: 14px;
    border-radius: 4px 4px 0 0;
    outline: none;
    transition: all 0.3s ease;
}

.cyber-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.cyber-label {
    position: absolute;
    top: 18px;
    left: 10px;
    color: #888;
    font-size: 13px;
    font-family: 'Courier New', Courier, monospace;
    pointer-events: none;
    transition: 0.3s ease all;
    letter-spacing: 1px;
}

/* 繝輔Ο繝ｼ繝・ぅ繝ｳ繧ｰ繝ｩ繝吶Ν縺ｮ繧｢繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ */
.cyber-form-group input:focus ~ .cyber-label,
.cyber-form-group input:not(:placeholder-shown) ~ .cyber-label,
.cyber-form-group textarea:focus ~ .cyber-label,
.cyber-form-group textarea:not(:placeholder-shown) ~ .cyber-label {
    top: 2px;
    left: 10px;
    font-size: 10px;
    color: #4cc2ff;
    text-shadow: 0 0 5px rgba(76, 194, 255, 0.5);
}

.cyber-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    overflow: hidden;
}

.cyber-line::after {
    content: '';
    position: absolute;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #4cc2ff;
    transition: left 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 0 10px #4cc2ff;
}

.cyber-form-group input:focus ~ .cyber-line::after,
.cyber-form-group textarea:focus ~ .cyber-line::after {
    left: 0;
}

.cyber-status {
    position: absolute;
    top: -15px;
    right: 0;
    font-size: 10px;
    font-family: 'Courier New', Courier, monospace;
    color: #666;
    letter-spacing: 1px;
}

.cyber-status.valid { color: #4ade80; text-shadow: 0 0 5px rgba(74, 222, 128, 0.5); }
.cyber-status.invalid { color: #ff4466; text-shadow: 0 0 5px rgba(255, 68, 102, 0.5); }
.cyber-status.typing { color: #ffdd44; text-shadow: 0 0 5px rgba(255, 221, 68, 0.5); }

.char-counter {
    position: absolute;
    bottom: -18px;
    right: 0;
    font-size: 10px;
    font-family: 'Courier New', Courier, monospace;
    color: #aaa;
}

.cyber-error {
    background: rgba(255, 68, 102, 0.1);
    border-left: 3px solid #ff4466;
    color: #ffb3b3;
    padding: 10px 15px;
    font-size: 12px;
    margin-bottom: 20px;
    display: none;
    font-family: 'Courier New', Courier, monospace;
}

.cyber-btn {
    position: relative;
    display: block;
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #4cc2ff;
    color: #4cc2ff;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}

.cyber-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #4cc2ff;
    z-index: 0;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cyber-btn .btn-text {
    position: relative;
    z-index: 1;
}

.cyber-btn:hover {
    color: #000;
    box-shadow: 0 0 15px rgba(76, 194, 255, 0.6);
}

.cyber-btn:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.cyber-btn.secondary {
    border-color: #888;
    color: #aaa;
}
.cyber-btn.secondary::before { background: #888; }
.cyber-btn.secondary:hover { color: #000; box-shadow: 0 0 15px rgba(136, 136, 136, 0.6); }

/* Confirm Screen */
.cyber-confirm h2 {
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.confirm-data-grid {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 15px;
    margin-bottom: 30px;
    font-family: 'Courier New', Courier, monospace;
}

.confirm-label {
    color: #4cc2ff;
    font-size: 12px;
    text-align: right;
    padding-right: 10px;
    border-right: 1px solid rgba(76, 194, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.confirm-value {
    color: #e2e8f0;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 1.5em;
}

.cyber-btn-group {
    display: flex;
    gap: 15px;
}

.cyber-btn-group .cyber-btn {
    flex: 1;
}

.upload-progress {
    position: absolute;
    bottom: 0; left: 0; height: 3px;
    background: #fff;
    width: 0%;
    transition: width 0.1s linear;
    z-index: 2;
}

/* Success Screen */
.cyber-success {
    text-align: center;
    padding: 30px 10px;
}

.success-icon-wrap {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.success-svg {
    width: 100%;
    height: 100%;
}

.success-circle {
    animation: draw-circle 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.success-check {
    animation: draw-check 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.6s forwards;
}

@keyframes draw-circle { to { stroke-dashoffset: 0; } }
@keyframes draw-check { to { stroke-dashoffset: 0; } }

.success-title {
    color: #4ade80;
    font-family: 'Courier New', Courier, monospace;
    font-size: 20px;
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
    opacity: 0;
    animation: fade-in-up 0.5s ease 1s forwards;
}

.success-desc {
    color: #aaa;
    font-size: 13px;
    margin-bottom: 30px;
    line-height: 1.6;
    opacity: 0;
    animation: fade-in-up 0.5s ease 1.2s forwards;
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 繝悶Λ繧ｦ繧ｶ縺ｮ繧ｪ繝ｼ繝医ヵ繧｣繝ｫ・郁・蜍募・蜉幢ｼ画凾縺ｮ閭梧勹濶ｲ繝ｻ譁・ｭ苓牡繝ｪ繧ｻ繝・ヨ */
.cyber-form-group input:-webkit-autofill,
.cyber-form-group input:-webkit-autofill:hover, 
.cyber-form-group input:-webkit-autofill:focus, 
.cyber-form-group textarea:-webkit-autofill,
.cyber-form-group textarea:-webkit-autofill:hover,
.cyber-form-group textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff !important;
    -webkit-box-shadow: 0 0 0px 1000px rgba(0, 0, 0, 0.4) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ===== BOSS APPEARANCE ANIMATIONS ===== */

/* 遐ｦ蟠ｩ螢・ 繧ｬ繧ｿ繧ｬ繧ｿ謠ｺ繧後↑縺後ｉ蝨ｰ髱｢縺ｫ豐医・ */
@keyframes fort-collapse {
    0%   { transform: translateX(-50%) rotate(0deg) scale(1);    opacity: 1; filter: brightness(1) drop-shadow(0 2px 6px rgba(0,0,0,0.95)); }
    10%  { transform: translateX(calc(-50% - 3px)) rotate(-4deg) scale(1.05); filter: brightness(1.8) sepia(1); }
    20%  { transform: translateX(calc(-50% + 4px)) rotate(5deg) scale(0.97);  filter: brightness(2.5) sepia(1) hue-rotate(20deg); }
    30%  { transform: translateX(calc(-50% - 4px)) rotate(-6deg) scale(1.02); filter: brightness(1.5); }
    40%  { transform: translateX(calc(-50% + 3px)) rotate(4deg) scale(0.94) translateY(4px); filter: brightness(1.2); }
    55%  { transform: translateX(calc(-50% - 2px)) rotate(-3deg) scale(0.85) translateY(10px); opacity: 0.85; }
    70%  { transform: translateX(calc(-50% + 1px)) rotate(2deg) scale(0.7) translateY(20px);  opacity: 0.55; clip-path: inset(20% 0 0 0); }
    85%  { transform: translateX(-50%) rotate(0deg) scale(0.5) translateY(30px);  opacity: 0.2;  clip-path: inset(60% 0 0 0); }
    100% { transform: translateX(-50%) rotate(0deg) scale(0.3) translateY(40px);  opacity: 0;    clip-path: inset(100% 0 0 0); }
}

.kuni-cell.boss-disappearing .castle-icon {
    animation: fort-collapse 1.1s cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards;
    transform-origin: center bottom;
}

.kuni-cell.boss-disappearing {
    /* 繧ｻ繝ｫ縺ｯ蜍輔°縺輔★蜀・Κ縺縺大ｴｩ螢翫＆縺帙ｋ */
}

/* 蝨ｰ蜑ｲ繧後け繝ｬ繝ｼ繧ｿ繝ｼ繧ｨ繝輔ぉ繧ｯ繝・*/
@keyframes crack-pulse {
    0%   { opacity: 0; transform: translateX(-50%) scale(0.2); filter: brightness(3); }
    20%  { opacity: 1; transform: translateX(-50%) scale(1.3);  filter: brightness(2); }
    50%  { opacity: 0.8; transform: translateX(-50%) scale(1.1); filter: brightness(1.2); }
    100% { opacity: 0.6; transform: translateX(-50%) scale(1);   filter: brightness(1); }
}

.kuni-cell.boss-cracking::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 54px;
    height: 14px;
    background: radial-gradient(ellipse, rgba(255,120,0,0.9) 0%, rgba(200,40,0,0.6) 40%, transparent 70%);
    border-radius: 50%;
    animation: crack-pulse 0.5s ease-out forwards;
    pointer-events: none;
    z-index: 10;
}

/* 繝懊せ蝓主・迴ｾ: 蝨ｰ髱｢縺九ｉ霑ｫ蜉帶ｺ轤ｹ縺ｫ豬ｮ荳・*/
@keyframes boss-rise-from-ground {
    0%   {
        clip-path: inset(100% 0 0 0);
        transform: translateX(-50%) translateY(20px) scale(0.85);
    }
    15%  {
        clip-path: inset(85% 0 0 0);
        transform: translateX(calc(-50% - 2px)) translateY(18px) scale(0.88);
    }
    30%  {
        clip-path: inset(65% 0 0 0);
        transform: translateX(calc(-50% + 3px)) translateY(12px) scale(0.9);
    }
    50%  {
        clip-path: inset(35% 0 0 0);
        transform: translateX(calc(-50% - 2px)) translateY(6px) scale(0.95);
    }
    70%  {
        clip-path: inset(10% 0 0 0);
        transform: translateX(calc(-50% + 1px)) translateY(2px) scale(1.0);
    }
    85%  {
        clip-path: inset(0 0 0 0);
        transform: translateX(-50%) translateY(-3px) scale(1.08);
    }
    93%  {
        clip-path: inset(0 0 0 0);
        transform: translateX(-50%) translateY(1px) scale(0.97);
    }
    100% {
        clip-path: inset(0 0 0 0);
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* 蝨ｰ髱｢縺ｮ繝槭げ繝槫匐蜃ｺ繧ｨ繝輔ぉ繧ｯ繝・*/
@keyframes ground-burst {
    0%   { opacity: 0; transform: translateX(-50%) scaleX(0.1) scaleY(0.5); }
    20%  { opacity: 1; transform: translateX(-50%) scaleX(1.4) scaleY(1.2); filter: brightness(2); }
    50%  { opacity: 0.8; transform: translateX(-50%) scaleX(1.1) scaleY(0.9); }
    80%  { opacity: 0.4; transform: translateX(-50%) scaleX(0.9) scaleY(0.7); }
    100% { opacity: 0; transform: translateX(-50%) scaleX(0.8) scaleY(0.5); }
}

.kuni-cell.boss-appearing::before {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 50%;
    width: 70px;
    height: 20px;
    background: radial-gradient(ellipse, rgba(255,150,0,1) 0%, rgba(255,60,0,0.8) 35%, rgba(180,0,0,0.4) 65%, transparent 100%);
    border-radius: 50%;
    animation: ground-burst 1.4s ease-out forwards;
    pointer-events: none;
    z-index: 1;
}

/* boss-appearing荳ｭ縺ｯlegendary繧ｯ繝ｩ繧ｹ縺御ｻ倥＞縺ｦ縺・↑縺・◆繧・   legend-wrap縺ｮposition/陦ｨ遉ｺ繧偵％縺薙〒螳夂ｾｩ */
.kuni-cell.boss-appearing .legend-wrap {
    position: absolute;
    top: 0;
    left: 50%;
    width: 64px;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    transform-origin: center bottom;
    /* filter縺ｪ縺励・繧ｨ繝輔ぉ繧ｯ繝医↑縺励〒邏皮ｲ九↓豬ｮ荳翫☆繧九□縺・*/
    animation: boss-rise-from-ground 1.4s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* 繧ｻ繝ｫ蜈ｨ菴薙ｒ蟆代＠謠ｺ繧峨☆ */
@keyframes boss-cell-tremble {
    0%,100% { margin-left: 0; }
    15% { margin-left: -2px; }
    30% { margin-left: 3px; }
    45% { margin-left: -2px; }
    60% { margin-left: 2px; }
    75% { margin-left: -1px; }
    90% { margin-left: 1px; }
}

.kuni-cell.boss-appearing {
    animation: boss-cell-tremble 0.4s ease-in-out 3;
    /* legendary 縺ｨ蜷後§繧ｵ繧､繧ｺ縺ｫ縺励※縺翫￥ 竊・legendary莉倅ｸ取凾縺ｫ繧ｬ繧ｿ縺､縺九↑縺・*/
    width: 76px;
    height: 84px;
    z-index: 4;
}

/* 蝨ｰ髴・お繝輔ぉ繧ｯ繝・ 繝槭ャ繝怜・菴薙ｒ謠ｺ繧峨☆ */
@keyframes map-earthquake {
    0%,100% { transform: translate(0, 0); }
    10% { transform: translate(-4px, -3px); }
    20% { transform: translate(5px, 2px); }
    30% { transform: translate(-5px, 4px); }
    40% { transform: translate(4px, -3px); }
    50% { transform: translate(-6px, 2px); }
    60% { transform: translate(5px, -4px); }
    70% { transform: translate(-4px, 3px); }
    80% { transform: translate(3px, -2px); }
    90% { transform: translate(-2px, 2px); }
}

#kuni-map.earthquake {
    animation: map-earthquake 0.12s linear 8;
}

/* 逑ｦ遉ｫ繝代・繝・ぅ繧ｯ繝ｫ */
@keyframes rubble-fly {
    0%   { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translate(var(--rx), var(--ry)) rotate(var(--rr)) scale(0.3); opacity: 0; }
}

.kuni-rubble {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 1px;
    background: #8a7060;
    pointer-events: none;
    z-index: 20;
    animation: rubble-fly 0.8s ease-out forwards;
    transform-origin: center;
}

/* 繝懊せ逋ｻ蝣ｴ譎ゅ・襍､縺・ヵ繝ｩ繝・す繝･繧ｪ繝ｼ繝舌・繝ｬ繧､ */
@keyframes boss-flash-overlay {
    0%   { opacity: 0; }
    15%  { opacity: 0.55; }
    40%  { opacity: 0.35; }
    70%  { opacity: 0.15; }
    100% { opacity: 0; }
}

#kuni-boss-flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at var(--fx, 50%) var(--fy, 50%), rgba(200,0,0,0.7) 0%, rgba(100,0,0,0.4) 40%, transparent 70%);
    pointer-events: none;
    z-index: 15;
    opacity: 0;
    border-radius: 6px;
}

#kuni-boss-flash.active {
    animation: boss-flash-overlay 1.8s ease-out forwards;
}


/* スマホでの陣取りゲームのステータスバー改行防止 */
@media (max-width: 500px) {
    #kuni-stats-bar {
        font-size: 10px;
        gap: 5px;
        padding: 5px;
        flex-wrap: nowrap;
        justify-content: space-around;
    }
}
/* =============================================
   Contact Form Tabs & FAQ (Cyberpunk Sticky Buttons)
   ============================================= */
.contact-tabs {
    position: sticky;
    top: -20px;
    display: flex;
    gap: 2px; /* わずかな隙間 */
    margin: -20px -20px 20px -20px;
    padding: 10px 20px 0;
    background: rgba(10, 20, 30, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(76, 194, 255, 0.2);
    z-index: 10;
}

.contact-tab-item {
    flex: 1;
    padding: 12px 15px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #8aacc1;
    background: linear-gradient(145deg, rgba(0,0,0,0.2), rgba(0,0,0,0.5));
    border: 1px solid rgba(76, 194, 255, 0.2);
    border-bottom: none;
    position: relative;
    text-align: center;
    transition: all 0.3s ease;
    clip-path: polygon(0 100%, 15px 0, calc(100% - 15px) 0, 100% 100%);
    text-shadow: 0 0 2px rgba(138, 172, 193, 0.5);
    animation: pulse-faint 4s infinite ease-in-out;
}

.contact-tab-item[data-text="FAQ"] {
    font-size: 15px;
}

@keyframes pulse-faint {
    0%, 100% { color: #8aacc1; text-shadow: 0 0 2px rgba(138, 172, 193, 0.5); }
    50% { color: #a2c0d5; text-shadow: 0 0 5px rgba(162, 192, 213, 0.7); }
}

.tab-icon {
    margin-right: 8px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.contact-tab-item:hover,
.contact-tab-item.active {
    color: #fff;
    background: rgba(0,0,0,0.3);
    border-color: rgba(255, 153, 0, 0.6); /* オレンジ系のアクセントカラー */
    text-shadow: 0 0 8px rgba(255, 153, 0, 0.8);
    animation: none; /* ホバー/アクティブ時はアニメーションを止める */
}

.contact-tab-item.active {
    background: rgba(45, 45, 45, 0.8);
    box-shadow: 0 0 20px rgba(255, 153, 0, 0.5), inset 0 0 10px rgba(255, 153, 0, 0.2);
    transform: translateY(-2px); /* 少し上に持ち上げる */
    border-width: 2px;
}

/* Glitch Effect */
.contact-tab-item::before,
.contact-tab-item::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    padding: 12px 15px;
    clip-path: inherit;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none; /* グリッチがクリックを妨害しないように */
}

.contact-tab-item:hover::before {
    left: 2px;
    text-shadow: -1px 0 #ff4466; /* 赤色グリッチ */
    opacity: 0.6;
    animation: glitch-anim 0.3s infinite linear alternate-reverse;
}

.contact-tab-item:hover::after {
    left: -2px;
    text-shadow: -1px 0 #4cc2ff; /* 青色グリッチ */
    opacity: 0.6;
    animation: glitch-anim-2 0.4s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
  0% { clip-path: polygon(0 2%, 100% 2%, 100% 98%, 0 98%); transform: translateX(2px); }
  25% { clip-path: polygon(0 50%, 100% 50%, 100% 100%, 0 100%); transform: translateX(-1px);}
  50% { clip-path: polygon(0 10%, 100% 10%, 100% 30%, 0 30%); }
  75% { clip-path: polygon(0 80%, 100% 80%, 100% 90%, 0 90%); transform: translateX(1px);}
  100% { clip-path: polygon(0 40%, 100% 40%, 100% 55%, 0 55%); transform: translateX(-2px);}
}

@keyframes glitch-anim-2 {
  0% { clip-path: inset(50% 0 30% 0); transform: translateY(-1px);}
  25% { clip-path: inset(10% 0 85% 0); }
  50% { clip-path: inset(70% 0 5% 0); transform: translateY(1px);}
  75% { clip-path: inset(40% 0 45% 0); }
  100% { clip-path: inset(80% 0 10% 0); transform: translateY(-1px);}
}

.contact-tab-item.active .tab-icon {
    opacity: 1;
    filter: drop-shadow(0 0 5px rgba(255, 153, 0, 0.8));
}


.contact-tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.contact-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.faq-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item[open] {
    background-color: rgba(45, 55, 75, 0.3);
}

.faq-item summary {
    padding: 18px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-left: 50px;
    transition: background-color 0.2s ease;
}
.faq-item summary:hover {
    background-color: rgba(76, 194, 255, 0.1);
}

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

.faq-item summary::before,
.faq-item summary::after {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    width: 14px;
    height: 2px;
    background-color: #4cc2ff;
    transition: transform 0.3s ease-in-out;
}

.faq-item summary::after {
    transform: translateY(-50%) rotate(90deg);
}
.faq-item summary::before {
    transform: translateY(-50%) rotate(0deg);
}

.faq-item[open] > summary::after {
    transform: translateY(-50%) rotate(0deg);
}

.faq-item[open] > summary::before {
    transform: translateY(-50%) rotate(180deg);
}

.faq-answer {
    overflow: hidden;
    padding: 0px 20px 20px 50px;
}


@keyframes faq-answer-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-item[open] .faq-answer {
    animation: faq-answer-fade-in 0.4s ease-out;
}

.faq-answer p {
    margin: 0;
    font-size: 14px;
    color: #b0c4de; /* 少し青みがかった白で見やすく */
    line-height: 1.7;
    border: none; /* 上のボーダーは削除 */
    margin-top: 0;
    padding-top: 0;
}


/* =============================================
   FAQ Search Input
   ============================================= */
.faq-search-container {
    margin-bottom: 20px;
}

#faq-search-input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    font-family: var(--font-family);
    transition: all 0.3s ease;
    outline: none;
}

#faq-search-input:focus {
    border-color: #ff9900;
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 10px rgba(255, 153, 0, 0.5);
}

#faq-search-input::placeholder {
    color: #888;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== スクロールトップボタン ===== */
.scroll-to-top-btn {
    position: sticky;
    bottom: 12px;
    left: 100%;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(76, 194, 255, 0.15);
    border: 1px solid rgba(76, 194, 255, 0.5);
    color: #4cc2ff;
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, background 0.2s ease, transform 0.2s ease;
    z-index: 10;
    box-shadow: 0 0 10px rgba(76, 194, 255, 0.2);
    flex-shrink: 0;
}

.scroll-to-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.scroll-to-top-btn:hover {
    background: rgba(76, 194, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 0 16px rgba(76, 194, 255, 0.4);
}

.scroll-to-top-btn:active {
    transform: scale(0.92);
}

/* 既存のボタン（▲）に、上下移動のスムーズなアニメーションを追加 */
.scroll-to-top-btn {
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.2s ease, color 0.2s ease !important;
}

/* 閉じるボタン（✕）固有のカラー設定 */
.bottom-close-btn {
    border-color: #ff4c4c !important; /* 閉じるボタンらしい赤のアクセント */
    color: #ff4c4c !important;
}

.bottom-close-btn:hover {
    background-color: #ff4c4c !important;
    color: #000 !important;
}

/* --- 一番下までスクロールした時の位置連動 --- */

/* 1. 上へ戻るボタン（▲）を 45px 上に押し上げる */
.window-content.is-bottom .scroll-to-top-btn:not(.bottom-close-btn) {
    transform: translateY(-45px) !important; 
}

/* 2. 閉じるボタン（✕）は元の位置（▲があった場所）に表示させる */
.window-content.is-bottom .bottom-close-btn {
    transform: translateY(0) !important;
}
/* ============================================================
   アップグレードポップアップ & 隕石
   ============================================================ */

.kuni-upg-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    background: rgba(20,35,15,0.95);
    border: 1px solid #3a5a1a;
    border-radius: 7px;
    padding: 5px 7px;
    min-width: 46px;
    cursor: default;
    transition: border-color 0.12s, background 0.12s, transform 0.1s;
    user-select: none;
}
.kuni-upg-btn.can-buy {
    border-color: #6ab830;
    cursor: pointer;
}
.kuni-upg-btn.can-buy:hover {
    border-color: #ffd700;
    background: rgba(50,80,15,0.98);
    transform: translateY(-2px);
}
.kuni-upg-btn.can-buy:active {
    transform: scale(0.93);
}
.kuni-upg-btn.at-max {
    opacity: 0.38;
}
.upg-icon  { font-size: 18px; line-height: 1.1; }
.upg-lv    { color: #ffd700; font-size: 9px; font-weight: bold; }
.upg-price { color: #aaa; font-size: 9px; min-height: 11px; }
.kuni-upg-btn.can-buy .upg-price { color: #ffd700; }
