@charset "utf-8";
/* ============================================================
    電卓・読み上げ・大きな文字の表示
    ============================================================ */

/* 大きな文字の表示の色の組み合わせ（遠くからでも読みやすい、はっきりした組み合わせ） */
:root{
    --boardDarkBg: #111111;
    --boardDarkInk: #ffffff;
    --boardLightBg: #ffffff;
    --boardLightInk: #111111;
    --boardPinkBg: #ff5c8a;
    --boardPinkInk: #ffffff;
    --boardYellowBg: #ffe14d;
    --boardYellowInk: #111111;
    --boardNeonBg: #0b0b1a;
    --boardNeonInk: #39ff88;
    --boardNeonGlow: rgba(57, 255, 136, 0.6);
}

/* ▼ 電卓 */
.calcLayout{
    display: grid;
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    gap: var(--spaceXl);
    align-items: start;
}
@media (max-width: 719px){
    .calcLayout{
        grid-template-columns: minmax(0, 1fr);
    }
}
.calcBody{
    padding: var(--spaceMd);
    border-radius: var(--radiusLg);
    background: var(--bgMuted);
}
.calcDisplay{
    position: relative;
    margin-bottom: var(--spaceMd);
    padding: 0.75rem 1rem;
    border-radius: var(--radiusMd);
    background: var(--bgCode);
    color: var(--textOnCode);
    text-align: right;
}
.calcExpr{
    min-height: 1.4em;
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.75;
    font-variant-numeric: tabular-nums;
}
.calcValue{
    margin: 0;
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
    cursor: copy;
}
.calcValue.isLong{
    font-size: 1.5rem;
}
.calcMemory{
    position: absolute;
    top: 0.5rem;
    left: 0.75rem;
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
}
.calcKeys{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.calcKey{
    min-height: 52px;
    border-radius: var(--radiusSm);
    background: var(--bgCard);
    box-shadow: 0 2px 0 var(--lineStrong);
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.calcKey.isFunc{
    font-size: 0.9375rem;
    color: var(--textSub);
}
.calcKey.isTax{
    font-size: 0.9375rem;
    color: var(--catText);
    background: var(--catSoft);
}
.calcKey.isOp{
    background: var(--catSoft);
    color: var(--catText);
}
.calcKey.isOp.isActive{
    background: var(--catColor);
    color: var(--textOnAccent);
}
.calcKey.isEqual{
    background: var(--btnBg);
    color: var(--textOnAccent);
    box-shadow: 0 2px 0 var(--btnShadow);
}
.calcKey.isClear{
    color: var(--danger);
}
.calcKey.isPressing{
    transform: translateY(2px);
    box-shadow: none;
}
.calcKey:focus-visible{
    outline: 3px solid var(--focusRing);
    outline-offset: 2px;
}
.calcOptions{
    margin-top: var(--spaceMd);
}
.calcOption{
    display: inline-flex;
    align-items: center;
    gap: var(--spaceXs);
    font-size: 0.875rem;
}
.calcOption .inputSelect{
    width: auto;
}
.calcHistoryHead{
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.calcHistoryHead .fieldLabel{
    margin: 0;
}
.calcHistory{
    max-height: 22rem;
    margin: var(--spaceSm) 0;
    padding: var(--spaceSm) var(--spaceMd) var(--spaceSm) 2.2em;
    overflow-y: auto;
    border-radius: var(--radiusSm);
    background: var(--bgCard);
    box-shadow: inset 0 0 0 1px var(--line);
    font-variant-numeric: tabular-nums;
    font-size: 0.9375rem;
}
.calcHistory li{
    margin: 0;
    padding: 0.2rem 0;
    border-bottom: 1px dashed var(--line);
}

/* ▼ 読み上げ */
.speechReading{
    max-height: 16rem;
    overflow-y: auto;
    margin-bottom: var(--spaceLg);
    padding: var(--spaceMd) var(--spaceLg);
    border-radius: var(--radiusMd);
    background: var(--bgCard);
    box-shadow: inset 0 0 0 2px var(--line);
    line-height: 2;
}
.speechSentence{
    cursor: pointer;
    border-radius: 4px;
}
.speechSentence.isDone{
    color: var(--textSub);
}
.speechSentence.isNow{
    background: var(--highlightSoft);
    box-shadow: 0 0 0 2px var(--highlight);
}

/* ▼ 大きな文字 */
.bigTextThemes{
    display: flex;
    flex-wrap: wrap;
    gap: var(--spaceSm);
}
.bigTextPreview,
.bigTextFull{
    display: grid;
    place-items: center;
    overflow: hidden;
}
.bigTextPreview{
    height: 220px;
    margin-bottom: var(--spaceLg);
    border-radius: var(--radiusMd);
}
.bigTextFull{
    position: fixed;
    inset: 0;
    z-index: var(--zSkipLink);
    cursor: pointer;
}
.bigTextFull:focus{
    outline: none;
}
.bigTextBody{
    margin: 0;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.bigTextStage[data-theme="dark"]{
    background: var(--boardDarkBg);
    color: var(--boardDarkInk);
}
.bigTextStage[data-theme="light"]{
    background: var(--boardLightBg);
    color: var(--boardLightInk);
    box-shadow: inset 0 0 0 2px var(--line);
}
.bigTextStage[data-theme="pink"]{
    background: var(--boardPinkBg);
    color: var(--boardPinkInk);
}
.bigTextStage[data-theme="yellow"]{
    background: var(--boardYellowBg);
    color: var(--boardYellowInk);
}
.bigTextStage[data-theme="neon"]{
    background: var(--boardNeonBg);
    color: var(--boardNeonInk);
}
.bigTextStage[data-theme="neon"] .bigTextBody{
    text-shadow: 0 0 0.08em var(--boardNeonGlow), 0 0 0.25em var(--boardNeonGlow);
}
.isVertical .bigTextBody{
    writing-mode: vertical-rl;
    text-orientation: upright;
}
.bigTextStage[data-move="scroll"] .bigTextBody{
    white-space: nowrap;
    animation: bigTextScroll 8s linear infinite;
}
.isVertical[data-move="scroll"] .bigTextBody{
    animation-name: bigTextScrollV;
}
.bigTextStage[data-move="blink"] .bigTextBody{
    animation: bigTextBlink 1s steps(2, start) infinite;
}
.isBigTextOpen body{
    overflow: hidden;
}
@keyframes bigTextScroll{
    from{ transform: translateX(60vw); }
    to{ transform: translateX(-100%); }
}
@keyframes bigTextScrollV{
    from{ transform: translateY(60vh); }
    to{ transform: translateY(-100%); }
}
@keyframes bigTextBlink{
    to{ visibility: hidden; }
}
@media (prefers-reduced-motion: reduce){
    .bigTextStage[data-move="scroll"] .bigTextBody,
    .bigTextStage[data-move="blink"] .bigTextBody{
        animation: none;
        white-space: pre-wrap;
    }
}
